Page 1 of 1

floodfill always ends up with transparent image

Posted: 2014-07-28T15:13:36-07:00
by Specialist
I have a script, which uses ImageMagick's convert command to floodfill an image, which has a black bar on the bottom and right page border, from the bottom right corner (to eliminate scanning artifacts). The rest of the image is mostly white:

Code: Select all

convert input.tif -fill white -draw "color 4879,6952 floodfill" +matte output.tif
(This example is for an image sized 4880x6953 px).

Previously, this worked fine on Ubuntu 12.04, which ships with ImageMagick 6.6.9.7. After upgrading to Ubuntu 14.04, which ships with v6.7.7.10, however, this command just produces a completely transparent image (instead of an image with the black bars replaced by white).

Any ideas?

Thanks!

Re: floodfill always ends up with transparent image

Posted: 2014-07-28T15:21:08-07:00
by fmw42
You are likely just floodfilling the bottom right where it is black. You will need to floodfill from the top left as well, so that you get both black and white floodfills. Sounds like the older IM had a bug. The current version is likely doing it right. If the color in the bottom left and top right are close to each other, then you can just add -fuzz XX% and do it in one location. You may still need -fuzz XX% to get it right with two floodfills.

You could upload your image to someplace like dropbox.com (public folder) and put the URL here so we can actually see what your image is like.

Re: floodfill always ends up with transparent image

Posted: 2014-07-29T00:42:55-07:00
by Specialist
The input is a monochrome image, which has the black bars in the bottom and right. The intention is to just fill that black portion. For an anonymized example, see: https://secure.tgbyte.de/dropbox/hcPrJtJsGzHO75WZ.tif

I want the main portion of the document to remain intact and just overwrite the black frame on the right and bottom with white. With v6.7.7.10 the whole image ends up as one large transparent area.

Re: floodfill always ends up with transparent image

Posted: 2014-07-29T01:50:16-07:00
by snibgo
On IM v6.8.9-5 on Windows 8.1, this works fine:

Code: Select all

F:\web\im>%IM%convert hcPrJtJsGzHO75WZ.tif -fill White -draw "color 4829,6968 floodfill" +matte out.tiff

Re: floodfill always ends up with transparent image

Posted: 2014-07-29T10:02:15-07:00
by fmw42
Works fine for me, too. I am on IM 6.8.9.6 Q16 Mac OSX