Page 1 of 1

Bug in -threshold

Posted: 2007-11-12T18:35:56-07:00
by fmw42
Documentation for -threshold on http://www.imagemagick.org/script/comma ... #threshold

says:

Create an image such that any pixel sample that is equal to, or exceeds the threshold, is reassigned the maximum intensity otherwise the minimum intensity.

To generate an all-black or all-white image with the same dimensions as the input image, you can use.

convert -threshold 65535 in.png black.png
convert -threshold 0,0 in.png white.png

but when I do either of the following, I see that the histogram shows

convert -size 256x256 gradient: -threshold 0 -format %c histogram:info:
65280: (65535,65535,65535, 0) #FFFFFFFFFFFF white
256: ( 0, 0, 0, 0) #000000000000 black

convert -size 256x256 gradient: -threshold 0,0,0 -format %c histogram:info:
65280: (65535,65535,65535, 0) #FFFFFFFFFFFF white
256: ( 0, 0, 0, 0) #000000000000 black

I was expecting to see no pixels at graylevel ( 0, 0, 0, 0)


The same with the following syntax

convert -threshold 0 -size 256x256 gradient: -format %c histogram:info:
65280: (65535,65535,65535, 0) #FFFFFFFFFFFF white
256: ( 0, 0, 0, 0) #000000000000 black

I am using 6.3.6.4 and perhaps this is fixed in 6.3.6.10?

Re: Bug in -threshold

Posted: 2007-11-13T08:37:41-07:00
by magick
There is patch for the problem you reported in ImageMagick 6.3.7-0 Beta available sometime tomorrow. Thanks.

Re: Bug in -threshold

Posted: 2007-11-14T07:10:42-07:00
by mi
magick wrote:There is patch for the problem you reported in ImageMagick 6.3.7-0 Beta available sometime tomorrow. Thanks.
Could you post the patch here, please?

Re: Bug in -threshold

Posted: 2007-11-22T21:02:00-07:00
by anthony
This is NOT suposed to be a bug!!!!
and fixing the suposed bug interoduces a bug!

Read the option manual.

If you want to threshold everything you would use -threshold -1

Re: Bug in -threshold

Posted: 2007-11-23T09:05:15-07:00
by magick
Patch reverted in ImageMagick 6.3.7-1 Beta.