ColorProfile
What a file declares about the color space of its samples, as it declares it: ImageInfo.colorProfile reports it, and a decode with ColorTarget.Srgb or ImageKodec.convertToSrgb converts through it. Nearly every image is sRGB and says so or says nothing; the rest, such as a Display P3 photo or an Adobe RGB scan, draw with the wrong colors unless they are converted.
icc is the embedded ICC profile, byte for byte as the file holds it once decompressed or reassembled: PNG
iCCP, JPEGAPP2ICC_PROFILEsegments in sequence order, TIFF tag 34675, WebPICCP, JPEG 2000colrmethods 2 and 3, a BMP V5 header's embedded profile, GIF'sICCRGBG1012application extension.iccName, srgbIntent, gamma, chromaticities and cicp are PNG's own chunks: the
iCCPprofile name,sRGB's rendering intent (0 perceptual, 1 relative colorimetric, 2 saturation, 3 absolute colorimetric),gAMA's gamma times 100000 (45455 for the usual 1/2.2),cHRM's white point, red, green and blue x and y times 100000, andcICP's color primaries, transfer function, matrix coefficients and full-range flag (ITU-T H.273 code points). An AVIF'snclxcolour box, or its AV1 sequence header, gives cicp too, and so does the colour encoding a JPEG XL header names.contentLight and masteringDisplay describe HDR content: PNG's
cLLiandmDCvchunks, or an AVIF'sclliandmdcvboxes. contentLight holds the maximum content light level and the maximum frame-average light level in 0.0001 cd/m², and masteringDisplay the mastering display's red, green and blue x and y and its white x and y in 0.00002, then its maximum and minimum luminance in 0.0001 cd/m², as both formats store them.
Every field is null when the file does not hold it.
A conversion reads them in the order the format sets. A PNG's cICP comes first, then iCCP, sRGB, and gAMA with cHRM, as the PNG third edition orders them; elsewhere the ICC profile comes before cicp, as AVIF orders them.
Constructors
Properties
The data color space the profile's header names, trimmed: "RGB", "GRAY", "CMYK", "Lab" and so on; null without a profile or with a header too short.
The profile's description, such as "Display P3" or "Adobe RGB (1998)", read from its desc tag: v2's ASCII text or v4's first localized string. Null without a profile or when the tag is missing or damaged.