python-lcms2

Color management for NumPy, built on LittleCMS 2.

import lcms2

p3  = lcms2.convert(img, "sRGB", "Display P3")      # uint8 in, uint8 out
lab = lcms2.Profile("sRGB").transform(img, "Lab")    # float64 L*a*b*
lcms2.delta_e(lab_a, lab_b)                          # CIEDE2000, vectorized
lcms2.Profile(lcms2.spaces.oklab).save("oklab.icc")  # an ICC profile of OKLab

You want to…

Read

Install and convert a first image

Quickstart

Follow runnable examples, step by step

Examples

Open, inspect, edit and create ICC profiles

Profiles

Control intents, proofing, chains and device links

Transforms

Mix ICC profiles with OKLab, HSV, PQ…

Color spaces

Turn your own NumPy color math into an ICC profile

ICC authoring

Measure color differences, CIECAM02, white points

Colorimetry

Build perceptually uniform colormaps

Colormaps

Read and write measurement (CGATS / IT8) files

Measurement files (CGATS / IT8)

Know how dtypes and shapes become pixel formats

How arrays become pixel formats