18 releases (9 breaking)

0.10.1 Jul 9, 2024
0.9.0 Jun 7, 2024
0.8.1 Feb 3, 2024
0.7.0 Dec 30, 2023
0.1.0 Sep 9, 2022

#37 in Multimedia

Download history 31/week @ 2024-03-31 2/week @ 2024-04-07 6/week @ 2024-04-14 32/week @ 2024-04-21 23/week @ 2024-04-28 5/week @ 2024-05-05 47/week @ 2024-05-12 18/week @ 2024-05-19 20/week @ 2024-05-26 169/week @ 2024-06-02 48/week @ 2024-06-09 19/week @ 2024-06-16 9/week @ 2024-06-23 134/week @ 2024-06-30 184/week @ 2024-07-07 41/week @ 2024-07-14

370 downloads per month

MIT license

140KB
2K SLoC

Rust 2K SLoC // 0.1% comments Python 228 SLoC // 0.1% comments

ColCon 0.10.1

Comprehensive colorspace conversions in Rust.

Features

  • Pure Rust, no dependencies.
  • sRGB, RGB, CIE XYZ, CIE LAB, Oklab, JzAzBz, HSV
    • LCH/Cylindrical versions of all LAB spaces
  • Most functions compile to a C lib
  • Generic over F32/F64 with const alpha channel
  • FMA3 used where supported
  • Accurate across a wide variety of tests, referencing colour-science

Future

  • std::simd either after stabilization or as a nightly feature
  • More spaces?

F.A.Q.

Question Answer
Why? I greatly enjoy working with Uniform Color Spaces and wish to see them become more accessible and easy to use.

lib.rs:

Comprehensive colorspace conversions in pure Rust

The working data structure is [DType; ValidChannels], where DType is one of f32 or f64 and ValidChannels is either 3 or 4, with the 4th channel representing alpha and being unprocessed outside of typing conversions

Formulae are generally taken from their research papers or Wikipedia and validated against colour-science https://github.com/colour-science/colour

This crate references CIE Standard Illuminant D65 for functions to/from CIE XYZ

No runtime deps