Skip to main content
Inspiring
October 14, 2022
Question

Looking for info regarding Color Range

  • October 14, 2022
  • 4 replies
  • 1373 views

I'm looking for the magic numbers used inside all the Color Range Select Options ( colors and tones options ).

Is there any document giving this numbers ?

This topic has been closed for replies.

4 replies

Inspiring
October 31, 2022

Some infos about color range taken from a book (in the real world series) dating back from CS3 :

 

- for the select tones (shadows, midtones, highlights) options :

"Photoshop decides whether to select a pixel (or how much to select it ) based on its Lab luminance value"
with L value in lab mode being
for shadows
fully slected pixels = 1-40
partially selected pixels = 40-55

for midtones
fully slected pixels = 55-75
partially selected pixels = 40-55 and 75-85

for highylights
fully slected pixels = 80-100
partially selected pixels = 75-85

- for the select color (red, green, ...) options :
"The greater the difference between the color you choose and the other primaries,
the more the pixel is selected. (To get really tweaky for a moment, the percentage the
pixel is selected is the percentage difference between the color you choose
and the primary color with the next highest value.)"

 

___________________ end of the excerpt ____________________

 

With a BW gradient map adj layer I can reproduce, almost identically, the shape of the selection for a tones selection.

With a selective color adj layer, by adjusting the black slider, I can almost identically the shape of the selection for a color selection.

 

I'm still interested on how to exactly repdroduce selection resulting from a color range selection with a tones or color select option.

 

The Scott Valentine
Community Expert
Community Expert
November 8, 2022

If I understand, you want to identify specific values (or ranges of values) that will give you a selection result similar to what Color Range produces when you click on a discrete color. Is that correct? You plan to use that information to automate selections?

------------------------------------------------------------Never let your tools get in the way of your art!
Inspiring
November 9, 2022

Yes, that is what I'm after. 

For example, how to obtain the same selection as the one we get when we use one of the Color Range option inside the Select Menu (Reds,Yellows, Greens, ...Shadows,Highlights, Midtones)

First, I was thinking of finding the magic numbers for use inside Color Range AM Code from Sampled Color(s) with the Color Range Eyedroppers but I'm not sure it's possible to obtain the same result as using the Color Range AM Code from a Select Pop-Up Menu option.

 I have also tried a different approach by using other tools like gradient or selective color adj layers.

In all case, the resulting selection I have obtained are not exactly identical to the Color Range non eyedropped ( one of  Reds,Yellows... or Shadows...inside the Select menu ) Selection.

Inspiring
October 17, 2022

I have made some discoveries for the Tones Select Options.

There are some other operations under the hood before the strict Color Range operation.

If I'm right there is a BW linear mapping of the image that is involved. After that, for the Color Range Shadows selection the magic numbers could be fuziness 45, L 27, a 0, b 0. For Highlights, I haven't already find the right numbers but something like fuziness 41, L79, a 0, b 0 seems very close.

Edited, cause it was total b...t !!!!

c.pfaffenbichler
Community Expert
Community Expert
October 17, 2022

Have you tried with pixel-identical images but at different Color Spaces? 

In a quick test I got identical results in sRGB and eciRGB v2, so it seems to me that Lab may not play a role here at all. 

Inspiring
October 17, 2022

OK, you are right...back to start point !!!!

PECourtejoie
Community Expert
Community Expert
October 14, 2022
Inspiring
October 14, 2022

Not really what I'am after, but it was interesting to read.

c.pfaffenbichler
Community Expert
Community Expert
October 14, 2022

I don’t seem to understand what you mean – »magic numbers«?  

Could you please explain with the help of screenshots or sketches? 

What relevance does it have for your workflow? 

Inspiring
October 14, 2022

If we record with the ScriptListener a Cyans or Shadows selection Color Range, we get a code that doesn't contain any number, instead we get a code that tells us the option that was selected in these cases we would get a code with stringIDToTypeID( "cyans" ) or stringIDToTypeID( "shadows" ).

I would like to know what are the min and max Lab numbers behind the cyans or shadows Color Range select options.

 

To make it even more clear :

How to transform this code,

 

var descriptor = new ActionDescriptor();
descriptor.putEnumerated( stringIDToTypeID( "colors" ), stringIDToTypeID( "colors" ), stringIDToTypeID( "cyans" ));
descriptor.putInteger( stringIDToTypeID( "colorModel" ), 0 );
executeAction( stringIDToTypeID( "colorRange" ), descriptor, DialogModes.NO );

into something like :

var descriptor = new ActionDescriptor();
descriptor.putInteger( stringIDToTypeID( "fuzziness" ),   ???????   );
var descriptor2 = new ActionDescriptor();
descriptor2.putDouble( stringIDToTypeID( "luminance" ),   ???????   );
descriptor2.putDouble( stringIDToTypeID( "a" ),   ???????   );
descriptor2.putDouble( stringIDToTypeID( "b" ),   ???????   );
descriptor.putObject( stringIDToTypeID( "minimum" ), stringIDToTypeID( "labColor" ), descriptor2 );
var descriptor3 = new ActionDescriptor();
descriptor3.putDouble( stringIDToTypeID( "luminance" ),   ???????   );
descriptor3.putDouble( stringIDToTypeID( "a" ),   ???????   );
descriptor3.putDouble( stringIDToTypeID( "b" ),   ???????   );
descriptor.putObject( charIDToTypeID( "Mxm " ), stringIDToTypeID( "labColor" ), descriptor3 );
descriptor.putInteger( stringIDToTypeID( "colorModel" ), 0 );
executeAction( stringIDToTypeID( "colorRange" ), descriptor, DialogModes.NO );

PECourtejoie
Community Expert
Community Expert
October 14, 2022
quote

I would like to know what are the min and max Lab numbers behind the cyans or shadows Color Range select options.


By @Panchromatic

 

That makes the question more clear. Too bad we do not have Chris Cox around there anymore...