I wrote this as an answer to Photo.StackExchange question, how to select by histogram range in Gimp.
Step-by-step
- Make a copy of the layer (Layer → Duplicate Layer)
- Select the duplicate layer, apply threshold (Colors → Threshold) to select the range of intensities.
- In Layer → Mask → Add Layer Mask (or right click in the list of layers). Select “Grayscale copy of layer” and “Invert mask”.
- idem: Mask to selection.
- Hide or remove the layer with mask.
An example:
An original image. I want to select the circle:
Make a copy of the layer:
Apply threshold. Note that the area to be selected is black:
Add Layer Mask using the grayscale value of the image:
Now you've obtained an image with the mask. Everything except the black circle is transparent (we can see the bottom layer through it):
Convert the mask to selection. Switch to the original layer. The circle is selected.