Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an image which looks like this:

Enter image description here

However, the yellow line needs to be red and the cyan line needs to be green. I have Paint and IrfanView. How can I change the colors of the yellow and cyan line without individually selecting all pixels manually?

That is, what is a good way of changing all pixels of one color to another color?

share|improve this question

Paint.NET will do it, You just need to do a fill, with 'global' mode instead of contiguous mode.

As per request. I'd note the original was horribly noisy and I cleaned it up a bit. You'd ideally want to clean this up first

enter image description here

There's a few important things here.

Firstly, I was zoomed into the image so I could pick the correct area more easily. There was a ton of anti-aliasing here so I ended up sharpening it (or otherwise cleaning it up), but even then, I went with a fairly high tolerance (The higher the tolerance, the less similar an adjoining pixel needs to be to its neighbours to be recoloured) Play with that value - lower is more 'precise' but you may need a higher value.

share|improve this answer
Could you please elaborate, step-by-step, for someone who has installed but isn't familiar with Paint.NET? – Kenny LJ Aug 27 '15 at 1:57
Added a quick gif and explanation. Its pretty simple, assuming you're starting with a clean image. The global vs contiguous option also exists for the magic wand tool, which can be useful, especially if you play around with tolerances. – Journeyman Geek Aug 27 '15 at 12:38

ImageMagick can do all sorts of fancy color replacements.

share|improve this answer

In games, many years ago we used *.PAL file editors to change one color per another. This is mostly for if your images are color indexed. (IE: Gifs are always color indexed)

It was used (also did again while doing mobile games) to change cloth colors so to make different enemies using only the memory in disk of a single one.

There are many tools, but as an example:

Also, you say you use irfanview, there's a plugin:

share|improve this answer

Pick an image editing program like Photoshop or GIMP (latter one is free), and paint the line with "Color" mode.

share|improve this answer
Gimp has select by color, which you can then fill with a different color. – Chris K Jun 19 '12 at 23:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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