Can someone provide some insight into the Gamma correction logic in the IPP library. From my understanding after reading the description (Gamma Correction (intel.com)), the Gamma correction is a "encoding" process to transform linear RGB into nonlinear R'G'B' for the proper color reproduction on the display. But it uses a different formula to the sRGB gamma encoding (sRGB - Wikipedia). It has not provided any explanation for that.
In addition, in the color model page (Color Models (intel.com)), it states that all color conversion functions take the gamma corrected RGB values, denoted by R', G' and B'.
But some of the functions, for example RGB2XYZ function, use R, G, B instead. Does that mean the RGB values are the linear RGB values?
Thanks for posting on Intel Communities.
As mentioned by you
- Gamma correction of images is used to optimize the usage of data type depth when encoding an image by taking advantage of the non-linear manner in which humans perceive light and color.
- This non-linearity must be compensated to achieve correct color reproduction.
- To do this, the luminance of each of the linear red, green, and blue components is reduced to a non-linear form using an inverse transformation.
We will get back to you soon with the other requested information.
But it uses a different formula to the sRGB gamma encoding
>>For different gamma formula in IPP vs sRGB(which was mentioned by you), IPP follow ITU-R BT.709 standard instead of IEC 61966-2-1 standard which was mentioned.
Thanks for sharing the feedback. Regarding the contradiction between the Color Model description and RGB2XYZ description, We are discussing the issue with the relevant team. We will get back to you soon with an update.
Could you clarify whether RGB2XYZ function operates in the linear RGB space?
>> Yes, we could see most of them are denoted by R', G' and B' in the IPP developer reference, but RGB2XYZ or XYZ2RBG functions, use linear R, G, and B instead. As informed, our team is working on the issue internally.
This is to kindly inform you, the contradiction between the Color Model description mentioned by you would be fixed in Intel IPP upcoming versions. You could refer to the IPP release notes for more information. We are closing the thread for now, If the issue still persists in the upcoming versions, we would like to request you to raise a new thread.
In addition to the above-mentioned information, “It looks like there are misprints in the description of Color Models in IPP Developer Reference. Linear RGB values should be used in RGBToXYZ/XYZToRGB functions.
More details can be found in [Foley90] James D. Foley, Andries van Dam, Steven K. Feiner, and John F. Hughes. Computer Graphics — Principles and Practice, Second Edition. Addison Wesley, 1990. This book is also mentioned in IPP bibliography.”
Hi, I'm noticing this too. You say it will be fixed in version 2021.9. If it adds to the conversation, the matrix to convert from RGB to XYZ in your documentation is for sRGB color space with D65 as you can see in one of the common references:
But you need to apply an inverse sRGB companding after the matrix:
So, actually the API gives wrong results because doesn't apply the companding, and if it's linear, those are not the right values.
And actually is assumed that the results are for sRGB as it says in the OneAPI documentation when you use de XYZ to LAB conversion.
So, there's a lot of different variables in color spaces and gamma and white point out there that maybe could not be tackled but using the right sRGB aproach could be the best for the most used cases but with the companding.
If you need more detailed information that could be useful, let me know but I know that you are working in the issue.
Thank you so much.