15 releases (7 breaking)

0.8.1 Feb 3, 2024
0.7.1 Jan 3, 2024
0.7.0 Dec 30, 2023
0.3.0 Nov 12, 2023
0.1.0 Sep 9, 2022

#39 in Multimedia

49 downloads per month

MIT license

71KB
1.5K SLoC

Rust 1.5K SLoC // 0.1% comments Python 176 SLoC // 0.0% comments

ColCon 0.8.1

Simple colorspace conversions in Rust.

Features

  • Pure Rust, no dependencies.
  • Most functions compile to a C lib
  • sRGB, RGB, CIE XYZ, CIE LAB, Oklab, JzAzBz, HSV
    • LCH/Cylindrical versions of all LAB spaces
  • Accurate across a wide variety of tests, referencing colour-science

Future

  • Look into SIMD when supported by standard library
  • More spaces?
  • Generic dtypes?

Known Issues

  • convert_space_sliced is slower than it could be. Waiting for slice_as_chunks to land in stable.
  • Performing many (>100) conversions in sequence will gradually degrade the data due to tiny precision issues accumulating.

F.A.Q.

Question Answer
Why? I just wanna say "go from this to this" without any fuss.

lib.rs:

Simple colorspace conversions in pure Rust.

All conversions are in-place, except when converting to/from integer and hexadecimal. 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