Photography Asked by bekoch on October 1, 2021
I am writing code for some color conversion work and have a confusion. My purpose for this conversion is to get the colors look reasonably correct in a typical non-professional display (PC, tablet etc) when I save as png or jpeg for example.
Here are my steps:
After the linear conversion above, I know that I must also apply the gamma-companding.
Thank you!
Which of the inverseM matrices shall I be using to get this right?
Use the sRGB, Bradford adapted inversion matrix: XYZ to RGB [M]-1
3.1338561 -1.6168667 -0.4906146
-.9787684 1.9161415 0.0334540
0.0719453 -0.2289914 1.4052427
This is used because everything involved in converting from/to L*a*b* and sRGB uses D50 even though D65 is the presumed display's white point. ICC profiles use D50 as the common reference white and primary chromaticity values in the ICC profiles are already adapted to D50. So D65 can be ignored.
Using L*a*b* 50 for the middle gray Colorchecker(tm) square, Conversion to XYZ should yield: XYZ=(0.177596 0.184187 0.151993) which is about 18% of D50 white.
Multiplying the inverting matrix M, with XYZ yields the sRGB value in linear gamma: RGB=(.184,.184,.184) which is expected. Note R=G=B and they are just above 18% reflectance which is L*50.
A good crosscheck is the BruceLindbloom calculator as shown here. Note gamma has been changed from sRGB's standard, modified 2.2 gamma to 1.0. If you wish to save the RGB values properly the sRGB gamma should be applied. You can also use the calculator to check your gamma algorithm if you pursue doing this.
Answered by doug on October 1, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP