WEBP Compression
Posted: Mon Jan 20, 2025 4:20 pm
Hi )
I can not understand , what in your version WEBP differ presets for compress level and absent compress 32 bit color , why this so ?
https://github.com/webmproject/libwebp
https://github.com/jacklicn/libwebp
Decode:
WebPGetDecoderVersion
WebPGetInfo
WebPDecodeRGBA
WebPDecodeARGB
WebPDecodeBGRA
WebPDecodeBGR
WebPDecodeRGB
Encode:
WebPGetEncoderVersion
WebPEncodeRGBA
WebPEncodeBGRA
WebPEncodeRGB
WebPEncodeBGR
WebPEncodeLosslessRGBA
WebPEncodeLosslessBGRA
WebPEncodeLosslessRGB
WebPEncodeLosslessBGR
and :
-preset must come first, as it overwrites other parameters
-z <int> ............... activates lossless preset with given
level in [0:fast, ..., 9:slowest]
-m <int> ............... compression method (0=fast, 6=slowest)
as I understand , in your XnView MP and XnConvert available presets only for lossy compression , that's why as I understand , I can not compress in lossless mode with maximum force )
Also , in your XnView MP and XnConvert absent RGBA compression for WEBP , although according to the standard this modes available in WEBP , why so ?
https://www.mediafire.com/file/xc68hk9i ... 4.rar/file
and from https://developers.google.com/speed/web ... iner?hl=en
Simple File Format (Lossless)
Note: Older readers may not support files using the lossless format.
This layout SHOULD be used if the image requires lossless encoding (with an optional transparency channel) and does not require advanced features provided by the extended format.
Simple File Format (Lossless)
Note: Older readers may not support files using the lossless format.
This layout SHOULD be used if the image requires lossless encoding (with an optional transparency channel) and does not require advanced features provided by the extended format.
Simple WebP (lossless) file format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| WebP file header (12 bytes) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
: 'VP8L' Chunk :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
'VP8L' Chunk:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ChunkHeader('VP8L') |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
: VP8L data :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
VP8L data: Chunk Size bytes
VP8L bitstream data.
The current specification of the VP8L bitstream can be found at WebP Lossless Bitstream Format. Note that the VP8L header contains the VP8L image width and height. That is assumed to be the width and height of the canvas.
Extended File Format
Note: Older readers may not support files using the extended format.
An extended format file consists of:
A 'VP8X' Chunk with information about features used in the file.
An optional 'ICCP' Chunk with a color profile.
An optional 'ANIM' Chunk with animation control data.
Image data.
An optional 'EXIF' Chunk with Exif metadata.
An optional 'XMP ' Chunk with XMP metadata.
An optional list of unknown chunks.
For a still image, the image data consists of a single frame, which is made up of:
An optional alpha subchunk.
A bitstream subchunk.
For an animated image, the image data consists of multiple frames. More details about frames can be found in the Animation section.
All chunks necessary for reconstruction and color correction, that is, 'VP8X', 'ICCP', 'ANIM', 'ANMF', 'ALPH', 'VP8 ', and 'VP8L', MUST appear in the order described earlier. Readers SHOULD fail when chunks necessary for reconstruction and color correction are out of order.
Metadata and unknown chunks MAY appear out of order.
Rationale: The chunks necessary for reconstruction should appear first in the file to allow a reader to begin decoding an image before receiving all of the data. An application may benefit from varying the order of metadata and custom chunks to suit the implementation.
Extended WebP file header:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| WebP file header (12 bytes) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ChunkHeader('VP8X') |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Rsv|I|L|E|X|A|R| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Canvas Width Minus One | ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... Canvas Height Minus One |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Reserved (Rsv): 2 bits
MUST be 0. Readers MUST ignore this field.
ICC profile (I): 1 bit
Set if the file contains an 'ICCP' Chunk.
Alpha (L): 1 bit
Set if any of the frames of the image contain transparency information ("alpha").
Exif metadata (E): 1 bit
Set if the file contains Exif metadata.
XMP metadata (X): 1 bit
Set if the file contains XMP metadata.
Animation (A): 1 bit
Set if this is an animated image. Data in 'ANIM' and 'ANMF' Chunks should be used to control the animation.
Reserved (R): 1 bit
MUST be 0. Readers MUST ignore this field.
Reserved: 24 bits
MUST be 0. Readers MUST ignore this field.
Canvas Width Minus One: 24 bits
1-based width of the canvas in pixels. The actual canvas width is 1 + Canvas Width Minus One.
Canvas Height Minus One: 24 bits
1-based height of the canvas in pixels. The actual canvas height is 1 + Canvas Height Minus One.
The product of Canvas Width and Canvas Height MUST be at most 2^32 - 1.
Future specifications may add more fields. Unknown fields MUST be ignored.
I can not understand , what in your version WEBP differ presets for compress level and absent compress 32 bit color , why this so ?
https://github.com/webmproject/libwebp
https://github.com/jacklicn/libwebp
Decode:
WebPGetDecoderVersion
WebPGetInfo
WebPDecodeRGBA
WebPDecodeARGB
WebPDecodeBGRA
WebPDecodeBGR
WebPDecodeRGB
Encode:
WebPGetEncoderVersion
WebPEncodeRGBA
WebPEncodeBGRA
WebPEncodeRGB
WebPEncodeBGR
WebPEncodeLosslessRGBA
WebPEncodeLosslessBGRA
WebPEncodeLosslessRGB
WebPEncodeLosslessBGR
and :
-preset must come first, as it overwrites other parameters
-z <int> ............... activates lossless preset with given
level in [0:fast, ..., 9:slowest]
-m <int> ............... compression method (0=fast, 6=slowest)
as I understand , in your XnView MP and XnConvert available presets only for lossy compression , that's why as I understand , I can not compress in lossless mode with maximum force )
Also , in your XnView MP and XnConvert absent RGBA compression for WEBP , although according to the standard this modes available in WEBP , why so ?
https://www.mediafire.com/file/xc68hk9i ... 4.rar/file
and from https://developers.google.com/speed/web ... iner?hl=en
Simple File Format (Lossless)
Note: Older readers may not support files using the lossless format.
This layout SHOULD be used if the image requires lossless encoding (with an optional transparency channel) and does not require advanced features provided by the extended format.
Simple File Format (Lossless)
Note: Older readers may not support files using the lossless format.
This layout SHOULD be used if the image requires lossless encoding (with an optional transparency channel) and does not require advanced features provided by the extended format.
Simple WebP (lossless) file format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| WebP file header (12 bytes) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
: 'VP8L' Chunk :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
'VP8L' Chunk:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ChunkHeader('VP8L') |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
: VP8L data :
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
VP8L data: Chunk Size bytes
VP8L bitstream data.
The current specification of the VP8L bitstream can be found at WebP Lossless Bitstream Format. Note that the VP8L header contains the VP8L image width and height. That is assumed to be the width and height of the canvas.
Extended File Format
Note: Older readers may not support files using the extended format.
An extended format file consists of:
A 'VP8X' Chunk with information about features used in the file.
An optional 'ICCP' Chunk with a color profile.
An optional 'ANIM' Chunk with animation control data.
Image data.
An optional 'EXIF' Chunk with Exif metadata.
An optional 'XMP ' Chunk with XMP metadata.
An optional list of unknown chunks.
For a still image, the image data consists of a single frame, which is made up of:
An optional alpha subchunk.
A bitstream subchunk.
For an animated image, the image data consists of multiple frames. More details about frames can be found in the Animation section.
All chunks necessary for reconstruction and color correction, that is, 'VP8X', 'ICCP', 'ANIM', 'ANMF', 'ALPH', 'VP8 ', and 'VP8L', MUST appear in the order described earlier. Readers SHOULD fail when chunks necessary for reconstruction and color correction are out of order.
Metadata and unknown chunks MAY appear out of order.
Rationale: The chunks necessary for reconstruction should appear first in the file to allow a reader to begin decoding an image before receiving all of the data. An application may benefit from varying the order of metadata and custom chunks to suit the implementation.
Extended WebP file header:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| WebP file header (12 bytes) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ChunkHeader('VP8X') |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Rsv|I|L|E|X|A|R| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Canvas Width Minus One | ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
... Canvas Height Minus One |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Reserved (Rsv): 2 bits
MUST be 0. Readers MUST ignore this field.
ICC profile (I): 1 bit
Set if the file contains an 'ICCP' Chunk.
Alpha (L): 1 bit
Set if any of the frames of the image contain transparency information ("alpha").
Exif metadata (E): 1 bit
Set if the file contains Exif metadata.
XMP metadata (X): 1 bit
Set if the file contains XMP metadata.
Animation (A): 1 bit
Set if this is an animated image. Data in 'ANIM' and 'ANMF' Chunks should be used to control the animation.
Reserved (R): 1 bit
MUST be 0. Readers MUST ignore this field.
Reserved: 24 bits
MUST be 0. Readers MUST ignore this field.
Canvas Width Minus One: 24 bits
1-based width of the canvas in pixels. The actual canvas width is 1 + Canvas Width Minus One.
Canvas Height Minus One: 24 bits
1-based height of the canvas in pixels. The actual canvas height is 1 + Canvas Height Minus One.
The product of Canvas Width and Canvas Height MUST be at most 2^32 - 1.
Future specifications may add more fields. Unknown fields MUST be ignored.