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

#54 in Multimedia

Download history 112/week @ 2024-07-22 28/week @ 2024-07-29 63/week @ 2024-08-05 28/week @ 2024-08-12 32/week @ 2024-08-19 40/week @ 2024-08-26 36/week @ 2024-09-02 26/week @ 2024-09-09 14/week @ 2024-09-16 50/week @ 2024-09-23 27/week @ 2024-09-30 36/week @ 2024-10-07 60/week @ 2024-10-14 24/week @ 2024-10-21 44/week @ 2024-10-28 47/week @ 2024-11-04

179 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