Replace Color Command – What am I missing?

DP
Posted By
Daryl_Pritchard
Jun 13, 2005
Views
895
Replies
8
Status
Closed
Hello all,

While I’ve not used the Replace Color Command often, it has typically provided me the results I was expecting when I have…until now. I thought the idea was that ANY color selected could be replaced with a new color, yet it seems that when the source color is a grayscale value, the replacement color is not a color substitution. Instead, the replacement colors seems to act more akin to a color filter on a black/white image. Had the image been a grayscale image with no color values in the color table to work from in a color substitution, perhaps such behavior would be expected. But, why for example would an RGB image not allow the substitution of a mid-gray with yellow, or red, or some other color? An illustration of this behavior can be seen in <http://jazzdiver.com/photoshop/replace_color.html> (1.6MB flash movie) where you can see how easily the color of the lioness’ eye can be changed yet not the color of the surrounding gray mat.

Thanks,

Daryl

How to Improve Photoshop Performance

Learn how to optimize Photoshop for maximum speed, troubleshoot common issues, and keep your projects organized so that you can work faster than ever before!

CK
Christine_Krof_Shock
Jun 13, 2005
Daryl…

The problem is that all of the color information has been removed from the grey matte either using desatuate or was done as an initial grayscale image…to add color

create a new layer and use the Magic Wand with contiguious checked to create a new selection of the grey areas you want to recolor, go to Edit>Fill and fill the layer with a selected color and change the layer’s blending mode to color….Merge down if you do not want an extra layer…
DP
Daryl_Pritchard
Jun 13, 2005
Christine,

That is what puzzles me…the layered image itself, and particularly the flattened one used for the demo Flash movie, are RGB images with full color available to replace color in the eye, yet not in the gray matte? A fill will definitely take care of it but had the Replace Color command worked as I expected, it would have provided a more versatile option where I could adjust color values via the HSB sliders until I had new mat colors that suited the image. The layered original image was created in RGB also, so I’d have thought the full color table would be available for use anywhere I chose to make an edit.

Thanks,

Daryl
MC
matt_charlton
Jun 13, 2005
Thats a great program that lets you record what you do and outputs to flash. Mind if I ask what that program is?
MC
matt_charlton
Jun 13, 2005
I just tried doing what you did with a grayscale picture that was rgb and the desired effect did conclude. I was able to change anything to anything.
G
GordonGraham
Jun 13, 2005
I’ve used an approach in a similar situation that you might want to experiment with. It’s a bit of a "brutal" solution, though.

The problem is that there is no color information in a truly grey area for the Replace Color function to work with. So if you can create some color there, without losing any image detail, then Replace Color can be used to modify the area to suit. One way of doing this is to use the Channel Mixer to modify one or more of the color channels in the grey area.

For example, you could select the grey area and then use Image>Adjustments>Channel Mixer to bring up the Channel Mixer dialog box. Then, for example, for the Red Source Channel, set the Red slider to zero and leave the Blue and Green sliders at zero, click OK.

Now the grey area should be cyan. Color Replacement will now work with this. Bring up the Color Replacement dialog and you should be able to modify Hue, Saturation and Lightness to suit.

By the way, if the area you are trying to modify is truly a neutral tone, then all three channels are identical so you shouldn’t lose any image detail by setting one of the channels to zero (black). It’s just a way of changing the neutral tone to something other than neutral so that Replace Color can work with it. It should work on any of the channels, not just red.
DP
Daryl_Pritchard
Jun 13, 2005
Matt,

Yes, the program I used for the screen capture video to flash conversion is indeed very nice….it is TechSmith’s Camtasia Studio, which I have only a few days remaining on a 30-day demo of. If you have a frequent need for such a capability, it may well be worth the $300 price.

Gordon,

You are apparently correct in what you’re saying. While I’ve never used the Channel Mixer, I appreciate the tips on how to use it in this situation.

I’m still very puzzled why this doesn’t work as expected. As you say there is no color information in a truly gray area, that suggests to me that any color fills, substitutions, etc., aren’t really from some sort of color lookup table as I’d have thought, but seemingly just from each individual pixel of color? I’m not sure I’m saying that right, but hopefully that makes sense. In other words, if an RGB image has a color table of 1 million colors for example, I’d have expected any color from that table – even grayscale values – to be replaceable with another color. Then, based upon the fuzziness setting, other colors close to source color would be replaced with some sort of averaged color deviation from the replacement color. But, that doesn’t appear true at least in the case of the Replace Color command.

For example, let’s say I have a 3×1 pixel image of the following colors:

[204/200/200] [200/200/200] [200/200/204]

Peforming a 0 fuzziness replacement of 200/200/200 with 255/0/0, I’d have expected to see

[204/200/200] [255/0/0] [200/200/204]

but actually see

[204/200/200] [122/122/122] [200/200/204]

In telling Photoshop that I want to make 200/200/200 a value now of 255/0/0, why doesn’t Replace Color give me that exact result?

As I continue to play with the fuzziness settings and consider that the sliders are for Hue, Saturation, and Lightness (same as Brightness?), all I can really make sense of is that what I expect to happen simply doesn’t. The HSL sliders imply to me that I’m not doing an exact RGB replacement, and maybe that’s the fundamental difference in what I expect to see versus what is actually occurring. But, on the whole, as long as I’m working with non-gray values, I do get more the results I’m expecting, so I guess I’ll not worry so much about the "why" of it all. And, when I do work with gray values, I’ll follow your suggestion in using the Channel Mixer.

Thanks,

Daryl
G
GordonGraham
Jun 13, 2005
I don’t understand how Photoshop does the color replacement well enough to give you a good answer. My guess is that the Color Replacement function is operating in HSL mode, not RGB mode. Grey doesn’t have a hue value, so there’s no way that it can manipulate or shift it.

I sort of get this but have to admit that my intuition would lead me to think that grey "should" behave just like any other color. But it doesn’t. It was thinking about that that led me to the idea of just modifying one of the color channels of the grey image so that it can be manipulated by the Replace Color function.

Probably those that really understand these things are shuddering right about now! The technique does seem to work, though.
DP
Daryl_Pritchard
Jun 13, 2005
"My guess is that the Color Replacement function is operating in HSL mode, not RGB mode. Grey doesn’t have a hue value, so there’s no way that it can manipulate or shift it."

Gordon, my guess is those two comments probably hit the nail on the head. Definitely not intuitive at first glance, but as long as it works…

Daryl

Master Retouching Hair

Learn how to rescue details, remove flyaways, add volume, and enhance the definition of hair in any photo. We break down every tool and technique in Photoshop to get picture-perfect hair, every time.

Related Discussion Topics

Nice and short text about related topics in discussion sections