How to program such a plugin?
I can't seem to find out how gimp handles the selection internally cause
then it would only be to
sum the pixels which had the "in selection" bit set to on or whatever.
I suppose it's a part of the
image struct which holds the information about the selected area???
Any good pointers where else to ask would also be appreciated.
--
- The Penguin's 1. We are better together than alone
- Postulate 2. If you push something hard enough it will fall over
- Morten S. Nielsen Dept. of Manuf. Engineering and Management
- mailto:m...@ipl.dtu.dk Building 425, 2. floor, DK-2800 Lyngby
> Does anybody know if it's possible to calculate the area of a selection
> in gimp?
>
> How to program such a plugin?
>
> I can't seem to find out how gimp handles the selection internally cause
> then it would only be to
> sum the pixels which had the "in selection" bit set to on or whatever.
> I suppose it's a part of the
> image struct which holds the information about the selected area???
>
> Any good pointers where else to ask would also be appreciated.
1. Edit / Save selection
2. Image /Histogram
Might help you....
Nevit
> "Morten S. Nielsen" wrote:
>
> > Does anybody know if it's possible to calculate the area of a selection
> > in gimp?
> >
> > How to program such a plugin?
> >
> > I can't seem to find out how gimp handles the selection internally cause
> > then it would only be to
> > sum the pixels which had the "in selection" bit set to on or whatever.
> > I suppose it's a part of the
> > image struct which holds the information about the selected area???
> >
> > Any good pointers where else to ask would also be appreciated.
>
> 1. Edit / Save selection
> 2. Image /Histogram
>
> Might help you....
It's quite close but it works on the entire layer not on a selection.
But thanks, it a good starting point.
Image / Histogram gives you a histogram for the current layer.
Use Image / Colors / Thresdhold... to get a similar graph but
just for the current selection in the current layer.
Austin
But I'm not interested in the histogram. I'm interested in the area
count. These data are only
presented in the histogram tool.
Furthermore the tool does not account for alpha so one has to divide the
area into three different areas with different colors, then the histogram
tool can be used to measure the area of my shape.
Things like a horizontal area count where the sum of eg. black 255 pixels
(or a region of pixels) in the region are summed as a function of row
I'll have to program myself.
> Nevit & Ilham wrote:
>
> > "Morten S. Nielsen" wrote:
> >
> > > Does anybody know if it's possible to calculate the area of a selection
> > > in gimp?
> > >
> > > How to program such a plugin?
> > >
> > > I can't seem to find out how gimp handles the selection internally cause
> > > then it would only be to
> > > sum the pixels which had the "in selection" bit set to on or whatever.
> > > I suppose it's a part of the
> > > image struct which holds the information about the selected area???
> > >
> > > Any good pointers where else to ask would also be appreciated.
> >
> > 1. Edit / Save selection
> > 2. Image /Histogram
> >
> > Might help you....
>
> It's quite close but it works on the entire layer not on a selection.
Let me explain in more detail...
Edit save selection saves your current selection and automatically drops you in
the saved channel which represents your selection. You are no longer in the
current layer, even though you have not done anything special to select the
saved selection channel! Right?
Step 2.
The next command Histogram will work on the saved selection...
You can now make precise calculations by dragging the mouse on the histogram
* Pixels Gives the total number of pixels you have/
* Count gives the number of pixels under the area you have selected in
Histogram
Others give extra information but we do not need right now.
Check this image out:
http://groups.yahoo.com/group/gimpi/files/Works/selection.xcf.gz
It is 450*300 pixel = 135000 pixels
I made a 150*100 pixels selection = 15000 pixels, saved...
(Go to saved selection channel... Image/ Histogram)
Select some area under histogram by dragging the mouse:
Count for the right end of histogram reads: 15000 (This is exactly my selected
area)
Count at the left end of Histogram : 120000 (=135000-15000) (This is uselected
area)
Nevit