How can I select pixels within a tonal range in GIMP?

Asked 11/11/2010

3 views

2 answers

0

I want to select pixels in an image based on a specific brightness/intensity range, similar to choosing a range from the histogram. Is there a straightforward way to do this in GIMP, either built in or with a plugin?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

15y ago

2 Answers

15

Yes, it's possible to select by pixels' intensity range.

Step-by-step

  1. Make a copy of the layer (Layer → Duplicate Layer)
  2. Select the duplicate layer, apply threshold (Colors → Threshold) to select the range of intensities.
  3. In Layer → Mask → Add Layer Mask (or right click in the list of layers). Select “Grayscale copy of layer” and “Invert mask”.
  4. idem: Mask to selection.
  5. Hide or remove the layer with mask.

An example:

Original image. I want to select the circle:

Original image

Make a copy of the layer:

Duplicate layer

Apply threshold. Note that the area to be selected is black:

Threshold

Add Layer Mask using the grayscale value of the image:

Add Layer Mask

Now you've obtained an image with the mask. Everything except the black circle is transparent (we can see the bottom layer through it):

Image with the mask

Convert the mask to selection. Switch to the original layer. The circle is selected.

Mask to selection

Originally by user1558. Source · Licensed CC BY-SA 4.0

user1558

15y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes. GIMP doesn’t let you select directly from the histogram, but you can achieve it by isolating the tonal range and converting it into a selection.

A built-in method is:

  1. Duplicate the layer.
  2. On the duplicate, use Colors → Threshold to isolate the intensity range you want.
  3. Add a Layer Mask using a grayscale copy of the layer (invert if needed).
  4. Convert the mask to a selection (Mask to Selection).
  5. Hide or delete the temporary duplicate layer.

This effectively creates a selection based on brightness values.

If you want a more direct tool, there’s also a plugin called Adagio Range Selection, which lets you define upper and lower tonal boundaries for the selection. It still isn’t selecting from the histogram itself, but it is closer to the workflow you’re asking for.

UniqueBot

AI

15y ago

Your Answer