mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 05:38:22 +01:00
Color profile specification in container spec
Change-Id: I53f849c7d93e1cdc971dda1fffd8f359f40607d3
This commit is contained in:
parent
a61a824b3a
commit
af6f0db291
@ -13,7 +13,7 @@ end of this file.
|
|||||||
WebP Container Specification
|
WebP Container Specification
|
||||||
============================
|
============================
|
||||||
|
|
||||||
_Working Draft, v0.5, 20120713_
|
_Working Draft, v0.6, 20121031_
|
||||||
|
|
||||||
|
|
||||||
* TOC placeholder
|
* TOC placeholder
|
||||||
@ -40,6 +40,9 @@ for:
|
|||||||
|
|
||||||
* **Transparency.** An image may have transparency, i.e., an alpha channel.
|
* **Transparency.** An image may have transparency, i.e., an alpha channel.
|
||||||
|
|
||||||
|
* **Color Profile.** An image may have an embedded ICC profile as described
|
||||||
|
by the [International Color Consortium][iccspec].
|
||||||
|
|
||||||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
|
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
|
||||||
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
|
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
|
||||||
document are to be interpreted as described in [RFC 2119][].
|
document are to be interpreted as described in [RFC 2119][].
|
||||||
@ -249,6 +252,8 @@ An extended format file consists of:
|
|||||||
|
|
||||||
* A 'VP8X' chunk with information about features used in the file.
|
* A 'VP8X' chunk with information about features used in the file.
|
||||||
|
|
||||||
|
* An optional 'ICCP' chunk with color profile.
|
||||||
|
|
||||||
* An optional 'ALPH' chunk with transparency information.
|
* An optional 'ALPH' chunk with transparency information.
|
||||||
|
|
||||||
* The image bitstream contained in either a 'VP8 ' or 'VP8L' chunk.
|
* The image bitstream contained in either a 'VP8 ' or 'VP8L' chunk.
|
||||||
@ -272,7 +277,7 @@ Extended WebP file header:
|
|||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
| ChunkHeader('VP8X') |
|
| ChunkHeader('VP8X') |
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
| Rsv |L| Rsv | Reserved |
|
| R |I|L| Rsv | Reserved |
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
| Canvas Width Minus One | ...
|
| Canvas Width Minus One | ...
|
||||||
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
@ -288,7 +293,11 @@ Alpha (L): 1 bit
|
|||||||
: Set if the file contains some (or all) images with transparency information
|
: Set if the file contains some (or all) images with transparency information
|
||||||
("alpha").
|
("alpha").
|
||||||
|
|
||||||
Reserved (Rsv): 3 bits
|
ICC profile (I): 1 bit
|
||||||
|
|
||||||
|
: Set if the file contains an ICC profile.
|
||||||
|
|
||||||
|
Reserved (R): 2 bits
|
||||||
|
|
||||||
: SHOULD be `0`.
|
: SHOULD be `0`.
|
||||||
|
|
||||||
@ -435,6 +444,28 @@ The formats of VP8 and VP8L chunks are as described in sections
|
|||||||
[Simple file format (lossy)](#simple-file-format-lossy)
|
[Simple file format (lossy)](#simple-file-format-lossy)
|
||||||
and [Simple file format (lossless)](#simple-file-format-lossless) respectively.
|
and [Simple file format (lossless)](#simple-file-format-lossless) respectively.
|
||||||
|
|
||||||
|
#### Color profile
|
||||||
|
|
||||||
|
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('ICCP') |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
| Color Profile |
|
||||||
|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|
||||||
|
|
||||||
|
Color Profile: _Chunk Size_ bytes
|
||||||
|
|
||||||
|
: ICC profile.
|
||||||
|
|
||||||
|
This chunk MUST appear before data for all the frames.
|
||||||
|
|
||||||
|
There SHOULD be at most one such chunk. If there are more such chunks, readers
|
||||||
|
MAY ignore all except the first one.
|
||||||
|
See the [ICC Specification][iccspec] for details.
|
||||||
|
|
||||||
|
If this chunk is not present, sRGB SHOULD be assumed.
|
||||||
|
|
||||||
#### Unknown Chunks
|
#### Unknown Chunks
|
||||||
|
|
||||||
A file MAY contain other unknown chunks. Readers SHOULD ignore these chunks.
|
A file MAY contain other unknown chunks. Readers SHOULD ignore these chunks.
|
||||||
@ -461,7 +492,16 @@ RIFF/WEBP
|
|||||||
+- VP8L (lossless bitstream)
|
+- VP8L (lossless bitstream)
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
A lossless image with ICC profile may look as follows:
|
||||||
|
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
RIFF/WEBP
|
||||||
|
+- VP8X (descriptions of features used)
|
||||||
|
+- ICCP (color profile)
|
||||||
|
+- VP8L (lossless bitstream)
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
[vp8spec]: http://tools.ietf.org/html/rfc6386
|
[vp8spec]: http://tools.ietf.org/html/rfc6386
|
||||||
[webpllspec]: https://gerrit.chromium.org/gerrit/gitweb?p=webm/libwebp.git;a=blob;f=doc/webp-lossless-bitstream-spec.txt;hb=master
|
[webpllspec]: https://gerrit.chromium.org/gerrit/gitweb?p=webm/libwebp.git;a=blob;f=doc/webp-lossless-bitstream-spec.txt;hb=master
|
||||||
[metadata]: http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf
|
[iccspec]: http://www.color.org/icc_specs2.xalter
|
||||||
[rfc 2119]: http://tools.ietf.org/html/rfc2119
|
[rfc 2119]: http://tools.ietf.org/html/rfc2119
|
||||||
|
Loading…
Reference in New Issue
Block a user