white-threshold

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
ursubaloo

white-threshold

Post by ursubaloo »

In a previous version of ImageMagick the following code would convert every pixel that wasn't fully black to white from the command line:

convert -white-threshold 1 zimage.png zimage.png

That no longer works, now the result of that call is an all-black canvas.
I've tried alternatives I've found by searching these forums, but none of the following seem to work:

convert input.jpg -white-threshold 57825 output.jpg
convert input.jpg -white-threshold 88% output.jpg

Variations of them all result in a black canvas. Is this a bug or am I a noob?

Help plx :)
ursubaloo

Re: white-threshold

Post by ursubaloo »

I think it's a a bug. I've found ImageMagick 5.5.7 and the command I first posted works as it should.

Did anyone else try this and have the same problem? If so I guess move to bugs section.

I remember reading a post from 2006 where this was broken and supposedly fixed in the following version. I guess it got broke again :P

viewtopic.php?f=1&t=12584&hilit=white+threshold

:P
ursubaloo

Re: white-threshold

Post by ursubaloo »

While I'm posting here I figure I might as well ask another question.

I've noticed that when trying to use the "convert" function from command-line in other folders via the PATH variable, there is a conflict with the "convert" function from system32 which is used to format drives.

I've just renamed the imagemagick convert to converti, but I was wondering if there's any more elegant work-around that I'm not aware of.

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

Re: white-threshold

Post by fmw42 »

I ran your white-threshold test (with correct syntax) but it fails for me, too. I suggest posting at Bugs forum.

Note your syntax is old. In future, use

convert inputimage -white-threshold 1 outputimage

see

http://www.imagemagick.org/Usage/basics/#why
Post Reply