It is currently Thu Apr 25, 2024 5:15 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: detecting whether a pixel is inside a selection (SOLVED!)
PostPosted: Thu Jul 24, 2014 3:49 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
GIMP Version: 2.8.10
Operating System: Windows
GIMP Experience: Beginner Level



Hi.
Is there a callable native gimp function (or a script/plug-in) able to detect whether a pixel (identified by the coordinates x1,y1) is inside or outside the active user selection?
This would be the optimum solution, otherwise, at least:
- is it possible to know the extreme (lowest, highest) x and y of the active user selection?
Thanks

edit: the second possibility is inside Gimp PDB: gimp-selection-bounds
so the help request remains only for the "inside/outside"...

_________________
"Where am I ?"


Last edited by dinasset on Thu Jul 24, 2014 7:26 am, edited 1 time in total.

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: detecting whether a pixel is inside a selection
PostPosted: Thu Jul 24, 2014 4:51 am  (#2) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
(vector-ref (cadr (gimp-drawable-get-pixel (car (gimp-image-get-selection image)) x y)) 0)

The above will evaluate to how much the pixel at x,y is selected. 0 means it is unselected and 255 means it is fully selected.

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: detecting whether a pixel is inside a selection
PostPosted: Thu Jul 24, 2014 5:36 am  (#3) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4827
Location: Bendigo Vic. Australia
Thanks Saulgoode I didn't even Know those commands were in the PDB

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: detecting whether a pixel is inside a selection
PostPosted: Thu Jul 24, 2014 7:18 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14816
Location: roma, italy
Many thanks, Saulgoode!

_________________
"Where am I ?"


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Line/pixel size doesnot correspond with pixel resolution

3

No new posts Script-fu select outline of image inside png

1

No new posts Attachment(s) Pixel Art Help

2

No new posts Pixel art experiment

6

No new posts Attachment(s) Use Shrink or Grow by 1 pixel on command

12



* Login  



Powered by phpBB3 © phpBB Group