-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for cICP chunk #218
Comments
Read support would be great for a PNG checker and write support would be great for tooling such as a utility to add |
@randy408 is there interest in adding cICP support (read/write) to libspng or is it still being evaluated? If there is interest, is there an estimate of the engineering effort involved and is it the sort of thing that might be suitable for an external contribution? Asking because we are seeing urgent need to a tool to add or edit this chunk, and currently the state of the art is to crowbar them in with a hex editor. |
I am planning on adding all HDR chunks at the same time when it's more set it stone, seeing how they're inter-related (e.g. requiring another HDR chunk to be set if another one is also set w3c/png#378). The unknown chunk API is at least a step above hex editing in terms of convenience: unsigned char cicp_data[4] =
{
1, // Colour Primaries
1, // Transfer Function
0, // Matrix Coefficients, always 0
0 // The Video Full Range Flag value MUST be either 0 or 1.
};
struct spng_unknown_chunk cicp =
{
.type = { 0x63, 0x49, 0x43, 0x50 },
.length = 4,
.data = cicp_data,
.location = SPNG_AFTER_IHDR, // Also means before PLTE
};
spng_set_unknown_chunks(ctx, &cicp, 1); There is a decode -> encode example in example.c, if you were to adapt that to insert metadata this snippet would go right after |
Thanks both for the confirmation that the HDR chunks are of interest, and also the practical guidance on how we can use libspng to create test images meanwhile. Standardization is a constant tension between polishing spec text and demonstrating implementability, and can often get into chicken-and-egg situations. |
The issue about |
Yet another colorspace chunk (this time for HDR), it's not finalized at the moment but Chrome is already adding support for it so it should be considered: https://chromium-review.googlesource.com/c/chromium/src/+/3705739
Proposal: https://github.com/w3c/ColorWeb-CG/blob/master/hdr-in-png-requirements.md#cicp-chunk
The text was updated successfully, but these errors were encountered: