Field notes/Mediarusty_iccICCcolour management

rusty_icc: ICC Colour Management Without LittleCMS

rusty_icc parses and writes ICC v2 and v4 profiles and runs matrix-shaper and LUT colour transforms in pure Rust, within 0.03 dE2000 of LittleCMS's exact pipeline.

Signed by M·
Painted artist at an easel holding colour swatches beside a canvas so the two match
What is rusty_icc?

rusty_icc is a pure-Rust ICC colour management crate from Remade with Rust. It parses and writes v2 and v4 profiles and runs matrix-shaper and LUT (lut8, lut16, mAB and mBA) transforms for RGB, CMYK, grey and Lab, with four rendering intents, black-point compensation, soft-proofing and gamut checks. It is Apache-2.0, has no C, no unsafe code and no dependencies, and version 0.1.1 is on crates.io.

Ship it

Within 0.03 ΔE2000

of LittleCMS's exact pipeline, in pure Rust with no dependencies.

Open the rusty_icc conversion pin →

rusty_icc is a pure-Rust ICC colour management crate. Version 0.1.1 parses and writes v2 and v4 profiles, runs matrix-shaper and LUT transforms for RGB, CMYK, grey and Lab, and lands within 0.03 delta E 2000 of LittleCMS's exact pipeline. It is Apache-2.0, with no C, no unsafe and no dependencies.

A colour profile is a small file that says what an image's numbers mean. Cameras embed one, scanners embed one, and print shops live by them. Converting through the profile is what keeps a red the same red on a phone, a monitor and a press. That conversion has long meant LittleCMS, a C library parsing profiles that arrive inside files from strangers. rusty_icc is the Remade with Rust replacement.

The rusty_icc repo landing carries the Cargo line and source links. The speed work behind this release is written up in the shared TIFF, image and ICC campaign note.

What rusty_icc Covers

Profiles in and out

The rusty_icc crate parses and writes ICC v2 and v4 profiles. Transforms cover matrix-shaper profiles, the common case for displays and cameras, and LUT profiles in lut8, lut16, mAB and mBA forms, the common case for print. Colour spaces include RGB, CMYK, grey and Lab.

Matrix-shaper and LUT, in plain terms

A matrix-shaper profile describes a device with three tone curves and a 3 by 3 matrix: straighten each channel, then mix the channels into a standard colour space. It is compact and fast, and it fits displays and most cameras. A LUT profile describes a device with a lookup table sampled across the colour space, plus curves on either side. It is bigger and slower, and it can model printers and inks that no matrix fits. The lut8 and lut16 forms come from ICC v2. The mAB and mBA forms come from v4 and chain curves, a matrix and a table in one transform. A colour engine that only handles the matrix case breaks on the first print profile, so rusty_icc implements both.

Intents, proofing and gamut

All four rendering intents are supported, along with black-point compensation, soft-proofing (showing on screen what a print will look like) and gamut checks (flagging colours a device cannot reproduce). Those are the features a print or photo workflow reaches for after the basic conversion works.

Accuracy against LittleCMS

rusty_icc results are within 0.03 delta E 2000 of LittleCMS's exact pipeline. A delta E of 1 is roughly the smallest difference a trained eye can see, so 0.03 is far below anything visible. Source sits under crates/rusty_icc in the remade_ffmpeg_rs monorepo, and releases go to crates.io.

Measured Speed in 0.1.1

Where rusty_icc leads

On pinned, interleaved (ABBA) runs, N=20, on the ArtCraft team's harness, rusty_icc is 1.40 times faster than LittleCMS on the 16-bit matrix-shaper transform and 1.14 times faster on Lab to sRGB in floating point. Against its own 0.1.0, wall-clock time fell between 1 and 37 percent depending on the transform.

Where LittleCMS still leads

On 8-bit paths, LittleCMS is faster. It gets there with fixed-point arithmetic, and adopting the same arithmetic would change rusty_icc's output, so 0.1.1 keeps its results and gives up that speed. Under callgrind, 0.1.1 retires 22 percent fewer instructions than 0.1.0 on matrix-shaper, 44 percent fewer on 8-bit RGB to CMYK and 66 percent fewer on profile parse and encode. Every output is byte-identical to 0.1.0.

Who should adopt it first

Photo and scan pipelines that already decode in Rust and want the colour step in Rust too, print and prepress tools that soft-proof, and services that accept images carrying embedded profiles from users. Profile parsing on untrusted files is the step that matters most for safety.

An embedded profile is a binary structure with tag tables, offsets and nested curve and table data, and a hostile file can lie about every one of those sizes. In a C engine, that lie can become an out-of-bounds read or write. In rusty_icc, the same lie becomes an error value, because the crate has no unsafe code to get it wrong in. The README backs that with a deterministic fuzz of 32,500 mutations over 13 seed profiles that produced no panic, and a counting allocator that holds the heap growth of any parse to 64 KiB plus 16 times the input.

How rusty_icc Fits the Constellation

Inside Media

TIFF and JPEG files often carry ICC profiles. rusty_tiff and rusty_jpeg hand the profile over, and rusty_icc converts the pixels. rusty_image and rusty_png complete the stills lane, and remade_ffmpeg_rs is the monorepo they ship from.

Across clusters

Colour-correct thumbnails land in SpaceDB, and Deputy audits the dependency graph before a node runs it. Because rusty_icc has no dependencies at all, that audit is short.

The API in a few calls

Profile::new_from_slice turns bytes into a profile, and built-ins such as Profile::new_srgb, Profile::new_display_p3 and Profile::new_rec2020 cover common targets without a file on disk. Transform::new takes a source and destination profile, a Layout for each side, an Intent and Options { black_point_compensation }, then transform converts u8, u16 or f32 buffers. Transform::new_proofing builds the screen, press, screen chain for soft proofs, and Profile::encode writes v4 profiles with MD5 profile IDs. A photo service on MATA.NETWORK can run this step right after decode with no C library in the image. For the wider case for rebuilding these libraries, read The Importance of Remade With Rust. The International Color Consortium publishes the profile specifications rusty_icc implements, and the NIST SSDF covers memory-safety policy.

FAQ

Quick answers for builders evaluating this technology.

What does rusty_icc replace?

It replaces LittleCMS (lcms2) on paths that parse ICC profiles and convert colour. Its results are within 0.03 delta E 2000 of LittleCMS's exact pipeline.

Is rusty_icc faster than LittleCMS?

On some paths. It is 1.40 times faster on the 16-bit matrix-shaper transform and 1.14 times faster on Lab to sRGB in float. LittleCMS still leads on 8-bit paths, because it uses fixed-point arithmetic, and copying that would change rusty_icc's output.

How much faster is rusty_icc 0.1.1 than 0.1.0?

Between 1 and 37 percent faster on wall clock, depending on the transform. Under callgrind it retires 22 percent fewer instructions on matrix-shaper, 44 percent fewer on 8-bit RGB to CMYK and 66 percent fewer on profile parse and encode. Outputs are byte-identical to 0.1.0.

Why does an image pipeline need ICC colour management?

Photos, scans and print files often carry an embedded ICC profile that says what their numbers mean. Without converting through it, colours shift between camera, screen and printer. rusty_icc reads that profile and does the conversion.

Where is the rusty_icc source?

rusty_icc lives in the remade_ffmpeg_rs monorepo under crates/rusty_icc on GitHub. Add it with cargo add rusty_icc.