It is currently Sun Aug 23, 2026 3:24 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 16 posts ] 
Author Message
 Post subject: Selection by color range
PostPosted: Sun Feb 24, 2013 11:24 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Two questions

1. When I use Select by Color Tool in gimp is there any way to find out the RGB values of the selected pixel (suppose threshold is 0)
2. Is there a script that would select pixels by color range, the same as Colors>Color to Alpha but for a wider range?
PS has a tool for that, gimp doesn't. I've tried Select by color with increased threshold or Shift-Click to add to selection, but the results are not the same.
When I do color range selection in PS it differs significantly.
You can do some experimenting in gimp to get a better idea of what i mean. Make a solid red layer below greyscale image and try to select pixels with Color to Alpha and then with Select by Color tool in gimp (change threshold value)
I know RobA wrote a scripts for that, but the link is broken and I can't find it anywhere to run a test.
Any workaround that you know of?


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Selection by color range
PostPosted: Sun Feb 24, 2013 1:36 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
http://chiselapp.com/user/saulgoode/rep ... lar-colors

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Selection by color range
PostPosted: Sun Feb 24, 2013 1:58 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Thanks saul, cool

_________________
Image


Top
 Post subject: Re: Selection by color range
PostPosted: Sun Feb 24, 2013 2:35 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jul 17, 2012
Posts: 2769
interesting post, K1te, i remember needing something like this in the past

and thanks for yet another great script, saulgoode ! :bigthup


Top
 Post subject: Re: Selection by color range
PostPosted: Sun Feb 24, 2013 3:05 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
K1TesseraEna wrote:
[font=Tahoma]Two questions

1. When I use Select by Color Tool in gimp is there any way to find out the RGB values of the selected pixel (suppose threshold is 0)

The Pointer dialog (Windows/Dockable dialog/Pointer) will tell your the RGB (and HSV) values of the pixel under the pointer.

_________________
Image


Top
 Post subject: Re: Selection by color range
PostPosted: Sun Feb 24, 2013 5:36 pm  (#6) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
thanks Saulgoode, ofnuts!

pointer dockable dialog is something i've never happened to use before, i'am certainly going to make a use of it now.

saulgoode, thanks for the script, i have yet to run some tests and see if this is what i need. Will report back later.


Top
 Post subject: Re: Selection by color range
PostPosted: Sun Feb 24, 2013 6:29 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
Quote:
The Pointer dialog (Windows/Dockable dialog/Pointer) will tell your the RGB (and HSV) values of the pixel under the pointer

I have never seen that before, that is a really cool tool.

_________________
Image


Top
 Post subject: Re: Selection by color range
PostPosted: Sun Feb 24, 2013 9:25 pm  (#8) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
K1t maybe http://blog.patdavid.net/2012/07/gettin ... color.html can be utility.

_________________
bbbbbbbbbbbImage
bbbbbbbbbbb Be patient, English is not my language.


Top
 Post subject: Re: Selection by color range
PostPosted: Sun Feb 24, 2013 10:01 pm  (#9) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Akros wrote:


Yes, helpful info on using multiple pointers to mark up canvas, thanks Akros.


Top
 Post subject: Re: Selection by color range
PostPosted: Mon Feb 25, 2013 2:14 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Jan 10, 2013
Posts: 863
K1t, rolling menus (most never used before or clicked) found the Rotate Colors (Colors>Map).
It seems to me another tool that could have this functionality "Selection by color range"

At the top you determines the range of colors to be changed, and in the low range of colors you want to get.

It works differently from the PS Color Range, and is not as immediate and efficient, but I think from now on I'll use it enough.
:seeya

_________________
bbbbbbbbbbbImage
bbbbbbbbbbb Be patient, English is not my language.


Top
 Post subject: Re: Selection by color range
PostPosted: Mon Feb 25, 2013 2:32 am  (#11) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Akros wrote:
K1t, rolling menus (most never used before or clicked) found the Rotate Colors (Colors>Map).
It seems to me another tool that could have this functionality "Selection by color range"

At the top you determines the range of colors to be changed, and in the low range of colors you want to get.

It works differently from the PS Color Range, and is not as immediate and efficient, but I think from now on I'll use it enough.
:seeya

"Rotate colors" should really be "Rotate hues".

_________________
Image


Top
 Post subject: Re: Selection by color range
PostPosted: Mon Feb 25, 2013 4:40 am  (#12) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2613
It is worth remembering that gmic has a color select filter, flexible and useful because it can output a mask.

Image


Top
 Post subject: Re: Selection by color range
PostPosted: Mon Feb 25, 2013 10:55 am  (#13) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
@Akros I agree with Ofnuts, we don't want to change the hue.

It seems I've found a workaround but it's a bit tedious. Still investigating, too early to post.

@rich selecting a color in gmic, creating a new layer, adding a greyscale image mask to it, copying that mask to main image does not really sound like an easy solution here, but at least gmic has a preview window. Replace Color filter seems to be more spot on, since it has an option to replace selected color with transparency.

Saulgoode's script replicates the Select by Color tool with the exact same tool options, and by definition (Scheme script) can't have a preview which is available in Color>Color_to_Alpha or PS's Color_Range.

Not much info in gimp documentation about the mechanism behind Color to Alpha function. But that's what I actually need with fuzziness/threshold control to pick analogous colors.


Top
 Post subject: Re: Selection by color range
PostPosted: Mon Feb 25, 2013 11:16 am  (#14) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
K1TesseraEna wrote:
Not much info in gimp documentation about the mechanism behind Color to Alpha function. But that's what I actually need with fuzziness/threshold control to pick analogous colors.

If you have GAP installed, try "Video->Bluebox...".

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Selection by color range
PostPosted: Mon Feb 25, 2013 11:26 am  (#15) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
K1TesseraEna wrote:
@Akros I agree with Ofnuts, we don't want to change the hue.

It seems I've found a workaround but it's a bit tedious. Still investigating, too early to post.

@rich selecting a color in gmic, creating a new layer, adding a greyscale image mask to it, copying that mask to main image does not really sound like an easy solution here, but at least gmic has a preview window. Replace Color filter seems to be more spot on, since it has an option to replace selected color with transparency.

Saulgoode's script replicates the Select by Color tool with the exact same tool options, and by definition (Scheme script) can't have a preview which is available in Color>Color_to_Alpha or PS's Color_Range.

Not much info in gimp documentation about the mechanism behind Color to Alpha function. But that's what I actually need with fuzziness/threshold control to pick analogous colors.

It is only reverse alpha-compositing. The color-to-alpha "contract" is simple:
layer with removed color stacked over layer filled with removed color = original layer

This definition leads to an ambiguity, for instance, if you remove white from an image with gray, the gray in the original layer could become either:
- fully opaque original gray
- partially opaque black
- any gray in the original gray->black range, with an opacity somewhere between the two above.

C2A makes it unambiguous and shoots for maximum transparency, so you would get partially transparent black in the case above.

One way to get a color selection using the rotate color:
- duplicate layer
- use Rotate Color to map your wide range of selectable hues into a very narrow one
- add another layer, fill with some color (not gray), and put in saturation mode
- new from visible
- color selection on that layer
- discard all added layers, but keep the selection.

_________________
Image


Top
 Post subject: Re: Selection by color range
PostPosted: Mon Feb 25, 2013 11:54 am  (#16) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
@saulgoode thank you, Bluebox seems more versatile that C2A or Color range!
@ofnuts I've been playing with C2A for a couple of days now, pretty much figured out how it works, for color range to work I run a sequence of C2A filter to get a color range out of the image.
Is it possible to get a gradient (as a color range) out of the image? Not talking about Full saturation spectrum gradients, of course. Simple dual-color or a bit more colored gradients. Just curious, don't see a practical need for that so far but it would be interesting to experiment with that.

Thank you all for contributing, that was a very useful and interesting experience.


Top
Post new topic Reply to topic  [ 16 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group