I'm trying to find a utility that can search an image for a specific RGB code and then highlight the exact pixels with that color code.

I can only find utilities that will tell me the RGB code if I mouse over a pixel, which is not what I need. I need something that can search an image for the RGB code.

  • highlighting the pixels will change the color :) That said, lots of programming languages have functions/classes for manipulating images. Looping across all pixels in an image looking for a specific color value is relatively trivial in several languages.
    – ivanivan
    Commented Jun 8, 2017 at 12:31
  • @ivanivan: perhaps it can be done like a selection tool: you can see what is selected but the pixels do not change their color. At least not at 400% zoom level Commented Jun 8, 2017 at 19:37

1 Answer 1


Option 1

Here's a Python program that takes an image file and two colors, from_rgb and to_rgb. It creates a new image that's equal to the input except that every pixel colored from_rgb is replaced with to_rgb.

import sys
from PIL import Image

from_rgb = (255, 255, 255)
to_rgb = (255, 0, 0)

with Image.open(sys.argv[1]) as im:
    im.putdata([to_rgb if x == from_rgb else x for x in im.getdata()])

Option 2

Use GIMP's Select by Color tool. Turn off antialiasing, set the threshold to 0, and click on a pixel with the color you want to find.

Select by Color settings

The marching ants in the below example are the result of clicking on one of the orange pixels.

Example selection

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.