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?


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.

  • 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
  • 1
    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.


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:



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

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

The free tool IrfanView has a tool do do this, and it will even do Batch processing (several files, or an entire folder, at once).

Go to File: Batch Conversion, then hit Advanced, then "Replace Color".

Batch Conversion:




Replace Color:


You can select a tolerance (the higher the number, the looser the match).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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