originrose / think.image

Eclipse Public License 1.0
11 stars 2 forks source link

rgb -> hsv -> rgb of 255 255 255 == 0 0 0 #13

Open bburdette opened 7 years ago

bburdette commented 7 years ago

You'd think that composing these functions would give you back the same color! It does, but just not if your color is pure white.

segmenticity.repl=> (tc/hsv->rgb (tc/rgb->hsv [255 255 255]))
[0 0 0]
segmenticity.repl=> (tc/hsv->rgb (tc/rgb->hsv [255 255 254]))
(255.0 255.0 254.0)
harold commented 7 years ago

Yeah, that looks like a bug. Add a failing test?

I'd expect some level of slush, due to non-linearity and floating-point representations. But black = white is wrong. :)

bburdette commented 7 years ago

One failing test! https://github.com/thinktopic/think.image/compare/hsv-test It looks like there's trouble when (= r b g) - unless they are all zero.