What is the source of the luminosity R/G/B weighting factors .35/.48/.17 used by PS when changing mode from RGB to grayscale?
Seems to be very close to the IRE values for NTSC, which is 0.3R, 0.59G. 0.11B. Has to add up to 1.)
Larry,
The weights I cited (.35/.48/.17, which do add up to 1) are decidedly different from .30/.59/.11 generally used in PS (and in the TV industry as well). I won’t confuse the issue by explaining how I got these weights, because I seem to be mistaken in noting their use in desaturating by switching to grayscale mode.
Under re-examination, there does not appear to be adherence to the initial luminosity, whatever channel weights might be assigned in defining luminosity.
That changes my question to: How does PS calculate the gray tone value which results when switching from RGB to Grayscale via Image>Mode?
George
Using the L from Lab instead of RGB?
George,
there are traditionally three options:
1. Y = 0.299*R´+0.587*G´+0.114*B´ (NTSC, nonlinear R´G´B´)
2. Y = 0.213*R +0.715*G +0.072*B (Rec.709, linear RGB)
3. Use CIE Y for the actual working space for linear RGB correctly.
I thought I had figured it out (for PhS 5.0):
<
http://www.fho-emden.de/~hoffmann/gray10012001.pdf>
Best regards –Gernot Hoffmann
Changing RGB to grayscale doesn’t use any fixed weights — it converts from your RGB document profile to LAB, then from L to your specified grayscale profile.
Desaturation uses a very different (and not so accurate) method.
To Lab ?
Convert linear RGB correctly to XYZ (my version 3).
Convert Y to grayscale (using the actual grayscale TRC).
Here we have partly a new aspect. Is the grayscale TRC
different to common RGB TRCs ? Do we have a linear slope if the grayscale is defined by Gamma or by Dot Gain ?
Heart of Darkness.
Lab doesn´t contribute anything, it´s just an overhead of unnecessary nonlinear calculations. Back and forth,
the nonlinearities are canceling each other.
Best regards –Gernot Hoffmann
In most cases, the L* conversion will be optimized out.
But it is useful in constructing the transforms.
Gernot, until I understand XYZ, Lab will have to do for me, and if Lab is what Photoshop is manipulating then all the better.
Now that Chris and Larry have pointed me toward Lab, I see that it is the Lab Luminance that is preserved in converting to grayscale via Image> Mode> Grayscale. Whether that is elegant or crude is beside the point when we are simply trying to understand what PS is doing, and that is my limited goal right now. Taking on XYZ is a more ambitious goal.
It is curious that PS preserves LUMINOSITY when desaturating via the Sponge tool while it preserves LUMINANCE when desaturating via a mode change, and while it preserves neither when desaturating via Image> Adjust> Desaturate or via Image> Adjust> Hue/Saturation. In the latter two cases, PS simply sets the resultant gray value by averaging the highest and lowest color channel values while ignoring the middle value. Exasperating! Can anyone defend these inconsistencies? Perhaps they are deliberate to provide a variety of results to suit different scenarios.
George
Some are based on HSB, some on HSL, some on the luminosity approximation (for speed), and accurate conversions are only done on mode change (because they’re slower).
Why are they inconsistent? Because they were written at different times, and we have to preserve the old behavior.
"accurate conversions are only done on mode change"…
Accurate with respect to what? My expectations, or should I say preference, would be that conversion from color to gray scale attempt to provide some sort of generic equivalence to panchromatic film, that is, a slight double hump around green, where green is slightly depressed.
But then, this sort of non-linearity in Panchro film has always been viewed as a deficiency, so perhaps leveling it out would be better!
Accurate meaning they take the document profile into account.
HSB, HSL don’t pay attention to the profile.
And Luminosity is just an approximation.
George,
RGB–Lab–RGB goes always through XYZ. Actually like this R´G´B´–RGB–XYZ–Lab–XYZ–RGB–R´G´B´(or gray in our case). Can be simplified
R´G´B´–RGB–Y–R´G´B´–RGB (all equal for gray)
Best regards –Gernot Hoffmann
Pierre,
as far as I remember the decomposition of R´G´B´
into YUV is used for PAL. Y is the same as NTSC
(my version No.1 in previous letter, directly
applied to gamma-encoded values R´G´B´).
The difference colors UV are merely mathematical
constructs. Editing in UV would hardly be useful,
unless it´s a TV application.
Editing in L of Lab is IMO not bad.
Editing in L of HLS works, but editing in B of
HSB=HSV is nonsensical, because B=Max(R´,G´,B´).
Sorry for not being able to give a more accurate
advice.
Best regards –Gernot Hoffmann