#icc #color #profile #sys #lcms

sys lcms2-sys

Bindings for liblcms2 (Little CMS) with support for Linux, macOS, and Windows. See lcms2 crate for a safe Rust wrapper

25 stable releases (3 major)

3.1.6 Jan 12, 2021
3.1.5 Oct 5, 2020
3.1.4 Jun 16, 2020
3.1.2 Oct 22, 2019
0.5.0 Jul 16, 2016

#1 in #sys

Download history 296/week @ 2020-10-02 442/week @ 2020-10-09 500/week @ 2020-10-16 470/week @ 2020-10-23 264/week @ 2020-10-30 207/week @ 2020-11-06 166/week @ 2020-11-13 174/week @ 2020-11-20 320/week @ 2020-11-27 644/week @ 2020-12-04 559/week @ 2020-12-11 439/week @ 2020-12-18 270/week @ 2020-12-25 376/week @ 2021-01-01 223/week @ 2021-01-08 199/week @ 2021-01-15

1,539 downloads per month
Used in 4 crates (via lcms2)

MIT license

24K SLoC

C 22K SLoC // 0.1% comments Rust 1.5K SLoC // 0.0% comments

Little CMS bindings for Rust

Makes LCMS C API available in Rust. There's also a higher-level wrapper.

It's up to date with version 2.9. Linux, macOS and Windows are supported. Other platforms may work, too.

Differences from the C API

  • Type names don't have the cms prefix, e.g. cmsColorSpace is ColorSpace.
    • All C function names remained the same (with the prefix, e.g. fn cmsReadTag()).
  • Enum values don't have the cmsSig prefix, e.g. cmsSigLabData is LabData.
  • Some arguments use more specific type, e.g. Intent::Perceptual enum instead of INTENT_PERCEPTUAL integer.

Dynamic vs static

If LCMS2_LIB_DIR environmental variable is set and contains either static or dynamic library, this libary will be used regardless of other settings.

The package supports "static" and "dynamic" Cargo features. If "dynamic" is selected (the default) then it will link to system-wide LCMS2 shared library if pkg-config is installed and working correctly.

If pkg-config doesn't work (i.e. on Windows), or the "static" feature is enabled, it will build LCMS 2.9 from source instead.

If LCMS2_STATIC environmental variable is set it will prefer static linking.


Make sure you clone with --recursive or run

git submodule update --init

before compiling.