Area detected by Color Fill Primitives

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
GregUK

Area detected by Color Fill Primitives

Post by GregUK »

Hi all

I'm using the following to fill the area surrounding a given pixel with a particular colour:

Code: Select all

convert input.jpg -fill red -fuzz 10% -draw "color 10,10 floodfill" output.jpg
This works great, but I am now looking for a way to draw a filled polygon over the detected colour area, rather than simply flood-filling it. Is it possible to get the location of the points bounding the detected area to pass into -draw polygon?

Many thanks
Greg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Area detected by Color Fill Primitives

Post by fmw42 »

As far as I know IM has no direct built in method. But Anthony came up with a combined technique. see http://www.imagemagick.org/Usage/transform/#edge_vector
GregUK

Re: Area detected by Color Fill Primitives

Post by GregUK »

Thanks, I'll take a look at the SVG method.

I've just had another idea: Is it be possible to apply the result of the floodfill to a separate mask image rather than the source image? If so, how would I do this?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Area detected by Color Fill Primitives

Post by fmw42 »

Post Reply