Page 1 of 1

Selective floodfill

Posted: 2010-12-10T20:05:05-07:00
by unhappycamper
I have many square-shaped images that are black and white, but have a rounded white border on each corner. I want to fill in those borders with black. So I'm wondering if there is a way to selectively floodfill only those four areas. Any insight would be appreciated.

Re: Selective floodfill

Posted: 2010-12-10T20:27:26-07:00
by GreenKoopa
-floodfill? Posting the image would help me see what you are describing.

Re: Selective floodfill

Posted: 2010-12-10T20:28:46-07:00
by unhappycamper
Thanks for your reply. I just figured out how to do it, with a composite command (with bumpmap).

Re: Selective floodfill

Posted: 2010-12-10T20:32:14-07:00
by anthony
An example would have helped...

Try -fuzz 1% -fill black -floodfill +0+0 white
and repeat the flood fill on each corner pixel.

This floodfill will only floodfill white corners and will ignore non-white corners.

Re: Selective floodfill

Posted: 2010-12-10T21:11:29-07:00
by unhappycamper
Yes, sorry, I just joined and wasn't sure how to post an image to the forum.

Here is what worked for me (before your suggestion):
composite 44.jpg inverted.jpg -compose bumpmap -gravity center 44_inverted.jpg

(inverted.jpg being the basic black and white image, inverting black and white, so that the corners were now black)

That command left some lines, so I just edited the inverted file to make sure the black bled into the image some more. And then ran it again, and it worked perfectly.

Thanks again for your suggestion.

Re: Selective floodfill

Posted: 2010-12-10T22:02:33-07:00
by fmw42
You need to find some free image hosting service, upload your image there. Then put a link here to that image. This forum does not allow direct upload of images.