w3c / png

Maintenance of the PNG specification
https://w3c.github.io/png/
Other
44 stars 11 forks source link

Color space chunk precedence is repeated in a lot of places #443

Closed fintelia closed 5 months ago

fintelia commented 5 months ago

Now that #439 added a table explaining the precedence of color space chunks, it would make sense to have the individual chunk descriptions link to it. Looking at the individual descriptions, none of them seem to be wrong, but the wording varies and it feels unnecessary to have this info repeated so many times.

All of this could be replaced with a line saying something like, "This chunk is ignored unless it is the highest-precedence color chunk [link] understood by the decoder."


cHRM:

An sRGB, iCCP or cICP chunk, when present and recognized, overrides the cHRM chunk.

gAMA:

An sRGB, iCCP or cICP chunk, when present and recognized, overrides the gAMA chunk.

iCCP:

When the iCCP chunk is present, PNG decoders that recognize it and are capable of color management shall ignore the gAMA and cHRM chunks and use the iCCP chunk instead and interpret it according to [[ICC]]. PNG decoders that are used in an environment that is incapable of full-fledged color management should use the gAMA and cHRM chunks if present.

sRGB:

When the sRGB chunk is present, it is recommended that decoders that recognize it and are capable of color management ignore the gAMA and cHRM chunks and use the sRGB chunk instead. Decoders that recognize the sRGB chunk but are not capable of color management are recommended to ignore the gAMA and cHRM chunks, and use the values given above as if they had appeared in gAMA and cHRM chunks.

cICP:

When the cICP chunk is present, decoders that recognize it SHALL ignore the following chunks: iCCP, gAMA, cHRM, and sRGB

ProgramMax commented 5 months ago

Marking as '3rd edition' but I do not want this to block Third Edition. This is really just cleanup.