-
Notifications
You must be signed in to change notification settings - Fork 11
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
Testing mDCv
#359
Labels
Milestone
Comments
I hacked ["mDCv", "Mastering Display Color Volume", false, (chunk, earlier) => {
addErrorIfHasType(earlier, "PLTE", chunk, "Chunk must be before PLTE chunk");
addErrorIfHasType(earlier, "IDAT", chunk, "Chunk must be before IDAT chunk");
if (chunk.data.length != 24) {
chunk.errorNotes.push("Invalid data length");
return;
}
let red_chromaticity_x = chunk.data[0]*256 + chunk.data[1];
let red_chromaticity_y = chunk.data[2]*256 + chunk.data[3];
let rx = (red_chromaticity_x * 0.00002).toPrecision(6);
let ry = (red_chromaticity_y * 0.00002).toPrecision(6);
chunk.innerNotes.push(`red: x = ${rx}, y = ${ry}`);
let green_chromaticity_x = chunk.data[4]*256 + chunk.data[5];
let green_chromaticity_y = chunk.data[6]*256 + chunk.data[7];
let gx = (green_chromaticity_x * 0.00002).toPrecision(6);
let gy = (green_chromaticity_y * 0.00002).toPrecision(6);
chunk.innerNotes.push(`green: x = ${gx}, y = ${gy}`);
let blue_chromaticity_x = chunk.data[8]*256 + chunk.data[9];
let blue_chromaticity_y = chunk.data[10]*256 + chunk.data[11];
let bx = (blue_chromaticity_x * 0.00002).toPrecision(6);
let by = (blue_chromaticity_y * 0.00002).toPrecision(6);
chunk.innerNotes.push(`blue: x = ${bx}, y = ${by}`);
let white_chromaticity_x = chunk.data[12]*256 + chunk.data[13];
let white_chromaticity_y = chunk.data[14]*256 + chunk.data[15];
let wx = (white_chromaticity_x * 0.00002).toPrecision(6);
let wy = (white_chromaticity_y * 0.00002).toPrecision(6);
chunk.innerNotes.push(`white: x = ${wx}, y = ${wy}`);
let max_lum = chunk.data[16]*256 + chunk.data[17];
let min_lum = chunk.data[18]*256 + chunk.data[19];
let max = (max_lum * 0.0001).toPrecision(4);
let min = (min_lum * 0.0001).toPrecision(4);
chunk.innerNotes.push(`Max luminance: ${max} cd/m²`);
chunk.innerNotes.push(`Min luminance: ${min} cd/m²`);
}], |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For browsers and image viewers, there is no normative requirement that can be tested:
If we are aware of implementations that do something with this, then we could check that they do different things with, say, one image reporting sRGB and then BT.2100 as mastering volume But what they actually do is completely unconstrained.
For a PNG validator or checker, it could report the presence of the chunk, check that the sizes of the data are correct and present the values, but that is about all.
For content creation tools, a list of tools that writes the chunk is helpful to demonstrate implementation.
The text was updated successfully, but these errors were encountered: