Crate colcon

source ·
Expand description

Simple colorspace conversions in pure Rust.

All conversions are in-place, except when converting to/from integer and hexadecimal. Formulas are generally taken from Wikipedia with correctness verified against both https://www.easyrgb.com and BABL.

Helmholtz-Kohlrausch compensation formulae sourced from https://onlinelibrary.wiley.com/doi/10.1002/col.22839

Currently, everything seems to check out except CIE XYZ. The Wikipedia formula matches EasyRGB, but BABL uses something different.

This crate references Standard Illuminant D65 when converting to/from the CIE colorspace. The feature flag D50 changes this to Illuminant D50, used by BABL (GIMP) and possibly other programs.

Enums

  • Defines colorspace pixels will take.

Constants

  • Illuminant D50, aka “printing” illuminant. Used by BABL/GIMP + others over D65, not sure why.
  • ‘Standard’ Illuminant D65.
  • Mean value of the HK delta, High et al 2023 implementation. Measured with 36000 steps in the hk_exmample file @ 100 C(ab) Cannot make a const fn: https://github.com/rust-lang/rust/issues/57241

Functions