3

I have a color specified in the CIE Lab* color space which is outside the range that standard sRGB monitors can display. I'd like to display an approximation of the given color (at the same luminance/L value as specified), but the maths is pretty gnarly and involves finding intersections between piecewise functions and so on.

Is there any reference code for this, or should I forge ahead with the maths?

To clarify: given a point a,b that is NOT within the shape below, I would like to find the nearest a,b that IS within the shape.

Lab color space

nornagon
  • 15,393
  • 18
  • 71
  • 85

1 Answers1

0

Here is an example using mat lab:

http://www.mathworks.com/matlabcentral/fileexchange/24009

Also there is a thread on the reverse function over here that mentions a site that has many programming examples for the conversion.

You could combine "CIE-L*ab —> XYZ" and the "XYZ —> RGB" conversion.


UPDATE:

I just found this: http://www.cs.washington.edu/research/imagedatabase/summerproject/2004/eye/src/yi/iu/processor/color/CIELab.java

But I couldn't find out what licence it uses, so maybe you should contact the author, if you are using it.

Community
  • 1
  • 1
devsnd
  • 7,382
  • 3
  • 42
  • 50
  • Converting between the colors is fine; what I'm looking for is a way to find the closest point within [this shape](http://en.wikipedia.org/wiki/File:Lab_color_space.png) to some `a,b` which is outsidce that shape. – nornagon Apr 25 '12 at 21:44