8

How do I replace a single Color in photoshop!?

All, and I really mean all, sites I find with Google either use the replace color tool box (which just replaces hue), the replace color tool (which just replaces hue and saturation), or use color adjustment layers, colorize, gradient layers, select color range, etc which all modify a (fussy) range of colors and can't be applied on a specific part of an image without going through extra trouble (layers).

I just want to quickly replace a single color, (eg. red 255,0,0,0) with another color (eg. Green 0,255,0), and do this often because I work with pixel art most of the time.

To illustrate it with Paint Shop Pro, this is what I want: enter image description here

3 Answers 3

5

A faster way to tackle this is:

  • Be sure that your Eyedropper Tool sample size is set to "Point Sample" and that you have unchecked "Contiguous" and "Anti-Alias". If your color is exact (no slight variations) then also set tolerance to 0. (Save this as a tool preset so it's easy to get to in the future.)

  • Use the Magic Wand tool to click one pixel of the target color. All the pixels of that color will now be 100% selected.

  • Set the Marquee (or Lasso, if you need an arbitrary selection area) tool to "Intersect With Selection" (the rightmost icon in the set), and select around the area you want to affect. This will deselect everything else in the image and leave only your target area selected.

  • Fill the selection with the new color.

The important difference between the Magic Wand tool and Select > Color Range is that Magic Wand is an all or nothing tool: a pixel is either 100% selected or 0% selected. Color Range selects gradiently, depending on the degree of match, channel by channel, between the target color and actual pixel.

Most of the time, Color Range is a far better selection tool than the Wand, but this is a case where the more primitive tool actually gets the job done faster and more accurately.

5
  • I can't figure this out... when something is selected with Marquee, clicking with Magic Wand inside the selection just wants to move the selection. Has this changed in the newest version?
    – Hrulga
    Commented Sep 9, 2012 at 18:20
  • Duh... Sorry, that came from the What Was I Thinking department. :-/ I've updated the answer so you have the right steps. Commented Sep 9, 2012 at 19:32
  • Yep, that works better. :-) You could move Contiguous and Anti-alias under the second bullet, since they're Magic Wand's settings... and I'm not sure does this need the Eyedropper at all, except for the fill color?
    – Hrulga
    Commented Sep 9, 2012 at 19:46
  • 1
    Magic Wand uses the Eyedropper setting, which is why you have to set that up first. Commented Sep 9, 2012 at 20:48
  • Ah, that's remarkably unintuitive. Good thing it's usually on the default setting. Good to know, thanksies!
    – Hrulga
    Commented Sep 9, 2012 at 21:17
3

Not sure if I've missed something, but can't you just:

  • define the area in which colour is to be replaced with the selection tool
  • Pick the new colour
  • switch to Fill tool, and set Tolerance to 0, Contiguous off
  • click on a pixel of the relevant colour (you can check the colour of the pixel under the cursor with the Info palette)
2
  • Yep, it isn't all that complicated, I think this is the simplest solution so far. :-)
    – Hrulga
    Commented Sep 10, 2012 at 18:45
  • Hmm weird, I tried contiguous on/off before and didn't see a difference (disconnected areas of the same color didn't get filled) but I tried again and now they do get filled. Commented Sep 12, 2012 at 5:54
0

As far as I know, Photoshop is kinda lacking a straightforward tool for color replacement. All I can really offer is a third method, which might be a touch more accurate, involving selecting a color range. And some keyboard shortcuts, in case you've missed one or two. :-)

To go along with your picture example:

  1. Sample the color you want to select. Shortcuts: I for eyedropper, or Alt-click with pen/brush.

  2. Use Marquee tool to select the area to adjust. Shortcut: M

  3. Go to menu Select -> Color range. Unselect Localized Color Clusters. Fuzziness set to 0 should work for exact color selection. No shortcut for this, but you can set it up if it helps. It should remember the settings too, so it'll be a bit faster the next time.

  4. Go to Color picker, and choose your new color.

  5. Fill the selected area with the new color. You could use menu Edit -> Fill (Shift-F5), but I'd just press Alt-Backspace. If you have your new color set up as background color, then try Ctrl-Backspace instead. And if there's still some of that sneaky transparency around, repeat this a couple of times.

  6. Clear selection with Ctrl-D.

Using background/foreground colors you can save a little bit time by doing both in advance. It might be possible to construct an Action from this, but I haven't played with Actions enough to get it working. It seems to remember the selected color while it was recorded. :-)

5
  • I don't know what in the world you mean by "Unselect Localized Color Clusters." All I know for Select Color Range is that it can select one color in the entire image (like the color I want to replace) but I want to just replace colors inside the marquee, not the entire image (which would require that extra 'trouble') Commented Sep 9, 2012 at 5:01
  • To illustrate the amount of effort needed in PSP (assuming I have the source and target colors set up in advance): 1. select region to affect using Selection tool (Marquee in PS), 2. Select Color Replacer tool, 3. Double-click somwehere in image. Commented Sep 9, 2012 at 5:06
  • @Zom-B The reason Hrulga says to use the marquee selection tool first is to limit the Color Range effect to the selected area. Commented Sep 9, 2012 at 16:50
  • Re: PSP, consumer-grade tools sometimes have quick-and-dirty ways of doing things that professional tools omit in favor of functions that are more flexible and powerful, but take more effort for trivial tasks. This applies in all markets, not just graphics. Sometimes a handy function migrates from the homeowner tool to the pro tool (the Spot Healing brush was in PSE before PS). Commented Sep 9, 2012 at 16:54
  • @Zom-B : Yeah, there's no single tool for this, just various workarounds. Color clusters here refers to the settings of the Color range dialog, though available settings might vary with different Photoshop versions (Mine is CS5). This method seems to be color accurate, works with marquee, and takes about 20 seconds to do with the shortcuts.
    – Hrulga
    Commented Sep 9, 2012 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.