Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-10-01 Thread Elle Stone
On 9/29/13, Michael Henning dra...@darkrefraction.com wrote: Sorry for the delay in replying; I wanted to take the time to properly look at everything you've said. If you managed to make your way through *everything* I said in my attempt to explain why the adapted values are the correct values

Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-09-29 Thread Michael Henning
Sorry for the delay in replying; I wanted to take the time to properly look at everything you've said. Yes, Elle, you're right. I take what I said back; we should be using the adapted values. If anyone is still doubting this, you can try playing around with this demo program I created:

Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-09-23 Thread Elle Stone
A technically correct luminance-based conversion to black and white is done using this formula: L = R*Yr + G*Yg + B*Yb where R, G, and B are the image RGB values for any given pixel and Yr, Yg, and Yb are the Y values from the image's actual ICC profile. If the profile white point isn't D50, the

Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-09-22 Thread Elle Stone
On 9/21/13, Michael Henning dra...@darkrefraction.com wrote: Both babl's RGB format and Y format are currently defined with a white point of D65. Because of this, I believe the code's current luminance values are correct. In other words, I think that the whitepoints are all currently

Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-09-22 Thread Michael Henning
I hope you don't mind; I reordered parts of your email when responding to it. Isn't the second (adapted) transform going to give us a D50 Y instead of a D65 Y? Yes, it will, and that's precisely what you want if you want to correctly calculate an sRGB image's Luminance values from its RGB

Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-09-22 Thread Elle Stone
On 9/22/13, Michael Henning dra...@darkrefraction.com wrote: Isn't the second (adapted) transform going to give us a D50 Y instead of a D65 Y? Yes, it will, and that's precisely what you want if you want to correctly calculate an sRGB image's Luminance values from its RGB values. The main

Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-09-21 Thread Michael Henning
Both babl's RGB format and Y format are currently defined with a white point of D65. Because of this, I believe the code's current luminance values are correct. Out of curiosity, how did you determine the Y values from the code in gegl/operations/external/lcms-from-profile.c ? If you're somehow

Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-09-21 Thread Elle Stone
On 9/21/13, Michael Henning dra...@darkrefraction.com wrote: Both babl's RGB format and Y format are currently defined with a white point of D65. Because of this, I believe the code's current luminance values are correct. The whitepoint of an ICC profile might have a D65 white point without a

Re: [Gimp-developer] Adapted and unadapted sRGB luminance values

2013-09-21 Thread Michael Henning
Those conversion factors are attempting to get a D65 Y from D65 RGB. So, we currently do a conversion like this, using unadapted values: D65 Y = 0.212656 * D65 Red + 0.715158 * D65 Green + 0.072186 * D65 Blue And you want us to do this, using the adapted values: Y = 0.222491 * D65 Red + 0.716888