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

Find and fill paths if closed, convert closed paths to transparent

Wed Apr 15, 2020 12:32 pm

Is it possible to do this in script-fu?

Go from Pronghorn.png, which has a transparent background.

Image

to Pronghorn1.png

Image

Here's how I did it manually:

Open Pronghorn.png
Select the open paths (lines in the head and on leg and thigh) and fill them with white.
Select the area just inside the closed path that makes up the outer edge of the Pronghorn.
Fill that area Black. This leave the 'islands' I want to keep transparent.
Export the File to Pronghorn1.png

Ideally I should have selected the 'white' open paths and filled them transparent before saving.

I have about 3000 images to process so, I'd like to be able to script it. I just don't know how to find the open paths, then fill inside the outer closed path.

Thank you

Re: Find and fill paths if closed, convert closed paths to transparent

Thu Apr 16, 2020 3:43 pm

This image likely comes frorm some vector graphics app (SVG, AI or EPS format). Do you have the vector files? This would be a lot easier.
Post a reply