Does anyone know how Photoshop 6 calculates the value "K" in the Grayscale
color info palette given values for RGB?
In a similar but somewhat inverse question, I'm trying to think through how
I could generate a table of RGB values that would take some "hue" (say, pure
Red) from K=0% to K=100%, stepping by 5%. For instance, pure Red (255,0,0)
has K of 41%. What calculations would I do to keep the same basic "hue" of
red, but take it from K=0 through K=41 to K=100?
At first I thought I could use the HSB colorspace rather than RGB and just
increase brightness B, but that's not the same as the grayscale K (which is,
I think, an approximation for "value", as in Munsell value).
Any suggestions appreciated... Thanks.
-ajwe
The gray values you get from colors also depend on how the conversion
is made. Grayscale conversion values are based on perceptual
brightness or lightness--the L in L*a*b, but there are other ways to
convert--Desaturation, Luminosity blend, Channel Mixer....
One way you could get a range of colors that approximately follow K
values by steps would be to create the gray steps, then with
Hue/Saturation, use "Colorize", and set the Hue and Saturation you
want. After the adjustment, Edit>Fade Hue/Saturation and select Color
as the blending mode. Maybe not mathematically precise, but should be
completely functional.
Ross
> Gray value percentages are dependent on your "Gray" setting in
> Edit>Color Settings (gamma or dot gain, depending on whether you are
> designing for screen or print, respectively). It's also dependent on
> the RGB color space that the image is in. For instance, pure red is
> K=41 in one space (gray gamma 2.2, Adobe RGB ???), but will be some
Right. Gamma 2.2 and Adobe RGB.
> The gray values you get from colors also depend on how the conversion
> is made. Grayscale conversion values are based on perceptual
> brightness or lightness--the L in L*a*b, but there are other ways to
> convert--Desaturation, Luminosity blend, Channel Mixer....
I've been experimenting with various formulas from the Poynton Color FAQ but
can't seem to come up with a formula that gets me reliably close to the
value of "K" that PhotoShop uses in the grayscale color "info" palette. FYI
(to other readers): The grayscale "K" value seems to correspond to what
happens when you change mode from RGB to Grayscale; i.e., if I create an
image with various colors, all of which have the same K, converting it to
Grayscale by switching mode produces a completely even-toned picture. The
other methods convert differently and you get areas with different levels of
gray. (BTW, when you monitor both K and L*a*b, the L* moves similarly to K,
but it's not linearly proportional...)
> One way you could get a range of colors that approximately follow K
> values by steps would be to create the gray steps, then with
> Hue/Saturation, use "Colorize", and set the Hue and Saturation you
> want.
This works very well for producing the scale -- thanks. I was hoping to use
a little program I wrote that can generate Photoshop Palette Files to
automatically create a palette for me using a set of colors I choose; the
palette would consist of colors of varying "value" (similar to Munsell
Value) ranging from K=0 to K=100. But I can't quite get the equations to
work out right. In any case, the method you describe makes it easy enough
for me to pick a hue and then manually grab colors at any level of K that I
choose.
Thanks,
-AJWE
K L
10 91
20 82
30 73
40 64
50 54
60 44
70 32
80 20
90 6
For a dot gain of 20%, the same L values result in K values of 13, 25,
37, 48, 58, 68, 78, 87, and 94.
Any palette of RGB colors you create based on K values would be
dependent on the gray work space in use--the same palette would
produce different K values. Also, if an image is in another RGB color
space than when the palette was created, those same RGB numbers in the
palette are now different colors, and hence, produce different K
values.
Here's another idea that you may find useful:
You could create an Action that builds a bunch of "swatches" with
varying Lightness. Pick a color that has a 50% associated K value.
Start the Action by creating a swatch (filled rectangular selection)
with the foreground color. Record, as a series of steps:
1. Copy original 50% swatch
2. Move copy (Transform relative)
3. Adjust>Hue/Saturation Lightness value on the copy (each +-10
adjustment on Lightness creates a +-5% change in K value if the before
value is 50%).
4. Select original 50% swatch layer
5. Repeat steps 1-4 using different transform and Lightness
adjustments for each copy.
The Action will create a bunch of swatches based on the current
foreground color. After the Action runs, you can either manually
create a color table with the Eyedropper and Swatches palette, or
convert to Indexed Color mode and save the Color Table
(Image>Mode>Color Table).
Ross