Bug in -threshold
Posted: 2007-11-12T18:35:56-07:00
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?
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?