IccProfile

The part of an ICC profile a document reader actually needs: the matrix/TRC shape that RGB and grey profiles use.

An ICC profile says how a file's numbers map to real colour. Ignoring it is what makes a photo tagged AdobeRGB look flat when it is drawn as if it were sRGB. This reads the tone curves and the colorant matrix, which is all a matrix/TRC profile has, and converts through XYZ.

Profiles that describe themselves with lookup tables (A2B0, mft1, mft2, mAB) are not read: parse returns null and the caller keeps its device-colour fallback. Those are mostly CMYK press profiles, where the device fallback is already what every other reader shows.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

1 for grey, 3 for RGB.

Link copied to clipboard

True when this profile IS sRGB (or near enough), so converting through it would only add rounding. Most PDFs tag their colours "sRGB IEC61966-2.1", and for those the honest transform is no transform: the round trip through XYZ costs about a level of 0..255 and buys nothing.

Functions

Link copied to clipboard
fun toRgb(components: DoubleArray): RgbColor

Convert components (0..1 per channel) to sRGB.