Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert sRGB to CIELAb and CIELab to sRGB efficiently? [closed]

Tags:

c++

srgb

I don't understand how to convert sRGB to CIELab and backward. Help me please. it's desirable in с++ code

like image 990
Conficker Avatar asked Oct 12 '10 13:10

Conficker


People also ask

How do you convert sRGB to linear?

A common workaround to convert sRGB to linear is to raise the values to the power of 2.2 (using a gamma node with gamma value of 2.2). To convert from linear to sRGB, you'd use a gamma value of 0.4545.

How do you convert XYZ to Lab?

Fast and Easy XYZ to LAB ConverterEnter or paste from clipboard XYZ color and push the “Convert” button. Then you will be able to copy the converted LAB color code to the clipboard. Convert colors in a moment!


1 Answers

Convert from sRGB to RGB by applying inverse gamma, convert RGB to XYZ using 3x3 matrix, convert XYZ to Lab using standard formula and D6500 white point

References:

  • Lab http://en.wikipedia.org/wiki/Lab_color_space
  • sRBG http://en.wikipedia.org/wiki/SRGB_color_space

The rest... you can do on your own :-)

like image 101
Artyom Avatar answered Nov 08 '22 08:11

Artyom