HSLuv, a developer friendly perceptual color space
> HSLuv is already available for many languages<p>btw, the JS port is not perf-optimized (it's a straight compilation from haxe to js).<p>i hand-ported the C version [1] locally that avoids heap-allocating any objects or arrays, which makes it about 40% faster. i'm hoping it gets to replace the "official" js port at some point, but i still need to run it through all the tests [2]. if anyone is interested in helping out with this (i'm tight on time right now), i'll publish it.<p>initial benchmark of 100k random RGB triplets completes in 100ms in Chrome 80 and 60ms in Firefox 73, on a pretty average Core i5-7500T @ 2.70GHz. 1M triplets is 680ms in chrome and 421ms in firefox. the official JS port gets 934ms in Chrome and 545ms in Firefox for 1M triplets.<p>For reference, a typical jpeg image contains < 300k unique colors.<p>[1] <a href="https://github.com/hsluv/hsluv-c" rel="nofollow">https://github.com/hsluv/hsluv-c</a><p>[2] <a href="https://github.com/hsluv/hsluv-c/blob/master/tests/scripts/snapshot-rev4.json" rel="nofollow">https://github.com/hsluv/hsluv-c/blob/master/tests/scripts/s...</a>