I am trying to convert back and forth between HSB color and Lab color in Processing / Java. I know that I can first convert HSB to RGB then to Lab, is it possible to directly convert from HSB to Lab? If so, how to do that?
Thanks a lot!
I am trying to convert back and forth between HSB color and Lab color in Processing / Java. I know that I can first convert HSB to RGB then to Lab, is it possible to directly convert from HSB to Lab? If so, how to do that?
Thanks a lot!
Unfortunately I can't provide a detailed answer.
There are fomulas of course: HSB, CIE XYZ as you'll need for sRGB to CIE XYZ to then convert CIE XYZ to Lab*. I'm sure you find implementations out
In terms of Java/Processing perhaps there is something already out there. FWIW you can check out this older example of mine using OpenFrameworks.
OpenFrameworks is to c++ as what Processing is to Java.
Hopefully you'll have no trouble swapping struct
for class
and #define
for float
, etc. The syntax is not that different in this case.