Page 1 of 1

"convert -edge" works OK in 32-bit build, wrong in 64-bit

Posted: 2013-12-02T14:41:19-07:00
by tongro
I can't find a way to upload sample images here, but the problem is fairly simple, so here goes.

I have a two-colour image consisting of black characters on a white background, and I want to convert it so that I get black character edges on a white background, or vice versa. So I run the command:

Code: Select all

convert in.png -edge 1 out.png
That works OK on my 32-bit computer, running the Debian Wheezy i386 build of ImageMagick 6.7.7.10-5. I get the edges in white on a black background, which is acceptable.

However, if I run the same command on the same image on my 64-bit computer, running the Debian Wheezy amd64 build of ImageMagick 6.7.7.10-5, the output is exactly the same (in pixels) as the input, which is not OK.

I'm certain this problem was not present on the 64-bit machine using older versions of ImageMagick, as the command is part of a script which used to work well, though I have no record of when it started failing.

So, is this a known bug? Has it been fixed in later versions? Is there a workaround for my particular task?

Thanks a lot.

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Posted: 2013-12-02T20:36:02-07:00
by snibgo
You can put your images somewhere like dropbox.com, and paste the links here. Then someone can test your command on various versions of IM.

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Posted: 2013-12-03T03:57:11-07:00
by tongro

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Posted: 2013-12-03T14:19:15-07:00
by glennrp
Running "convert original.png -edge 1 output.png" on Ubuntu 12.04 LTS, on a 64-bit
machine, using freshly-built ImageMagick-6.8.7-8 gives the correct output.

convert -version
Version: ImageMagick 6.8.7-8 Q16 x86_64 2013-11-28 http://www.imagemagick.org

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Posted: 2013-12-03T14:50:30-07:00
by snibgo
On Windows 7 it works fine on a load of different versions, including the recent 6.8.7-5, except for v6.8.1-10 which copies the input unchanged to the output.

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Posted: 2013-12-03T16:34:18-07:00
by glennrp
IM-6.8.1-10 works for me on my 64-bit Ubuntu platform.

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Posted: 2013-12-03T16:47:34-07:00
by tongro
OK, thanks.

I've now worked around the problem, converting the input file to ASCII PBM, then (using Perl) manipulating the pixels directly. It was not too difficult, and runs quickly enough.