16 releases (8 breaking)

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

#40 in Multimedia

Download history 83/week @ 2024-02-26 17/week @ 2024-03-04 18/week @ 2024-03-11 9/week @ 2024-03-18 3/week @ 2024-03-25 33/week @ 2024-04-01 7/week @ 2024-04-15 32/week @ 2024-04-22 24/week @ 2024-04-29 4/week @ 2024-05-06 47/week @ 2024-05-13 24/week @ 2024-05-20 13/week @ 2024-05-27 192/week @ 2024-06-03 30/week @ 2024-06-10

260 downloads per month

MIT license

75KB
1.5K SLoC

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

ColCon 0.9.0

Simple 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
  • FMA3 used where supported
  • Accurate across a wide variety of tests, referencing colour-science

Future

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

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