Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Re: Selected areas to separate layers script request (SOLVED)

Thu Sep 08, 2022 12:29 pm

This plug-in in GIMP could be helpful for astronomers or whoever wants to count stars in the sky or portion of sky.
In theory, you could load up an image of stars where the background is generally black.
Threshold it so that you get black & white at the right level that separates the stars from background.
Then turn background into transparent using Color to Alpha.
and use this plug-in.
Might have to change the default maximum number of shapes to a higher number since there could be many many stars in the sky.
might take sometime
But it beats counting manually and probably more accurate too.

Re: Selected areas to separate layers script request (SOLVED)

Thu Sep 08, 2022 1:07 pm

That's weird I tried it but it kept failing maybe I don't understand the script very well.
I set the max items to like 10,000 and threshold size to 0 but it's erroring.

Re: Selected areas to separate layers script request (SOLVED)

Thu Sep 08, 2022 3:10 pm

Another way: make a color selection on the stars (possibly using HSV Value or LCH lightness), `Select > To Path`, and then count the strokes of the path (for which, of course, I have a script). For objects with holes, I also have scripts to remove/split the nested strokes :)
Post a reply