Page 1 of 1

[RESOVED] possible bug -white-threshold IM 6.8.5.6 Q16

Posted: 2013-05-18T14:25:17-07:00
by fmw42
White threshold does not seem to be working correctly to me. Black threshold seems fine


IM 6.8.1.9 both look correct

im6819 convert -size 256x256 gradient: -black-threshold 50% -level 50x100% -negate 1tmp1_6819.png
Image

im6819 convert -size 256x256 gradient: -white-threshold 50% -level 0x50% 1tmp2_6819.png
Image



IM 6.8.5.6 black-threshold look correct; white-threshold does not

convert -size 256x256 gradient: -black-threshold 50% -level 50x100% -negate 1tmp1_6856.png
Image


convert -size 256x256 gradient: -white-threshold 50% -level 0x50% 1tmp2_6856.png
Image



Here is a simpler test. There seems to be a nonlinear vs linear grayscale difference now compared to before.

6.8.1.9

im6819 convert -size 256x256 gradient: -black-threshold 50% 2tmp1_6819.png
Image

im6819 convert -size 256x256 gradient: -white-threshold 50% 2tmp2_6819.png
Image


6.8.5.6

convert -size 256x256 gradient: -black-threshold 50% 2tmp1_6856.png
Image

convert -size 256x256 gradient: -white-threshold 50% 2tmp2_6856.png
Image


If I create a linear gradient, then the latter test works fine. (As does the first test set at the top)

6.8.1.9

im6819 convert -size 256x256 gradient: -black-threshold 50% 3tmp1_6819.png
Image

im6819 convert -size 256x256 gradient: -white-threshold 50% 3tmp2_6819.png
Image


6.8.5.6

convert -size 256x256 gradient: -black-threshold 50% 3tmp1_6856.png
Image

convert -size 256x256 gradient: -white-threshold 50% 3tmp2_6856.png
Image


It is strange to me that for non-linear gradient (or grayscale image), -black-threshold works fine but -white-threshold does not in my first pair of examples above. Perhaps this is just colorspace management. But why did it change. I thought gradients were supposed have the same data content.

Re: possible bug -white-threshold IM 6.8.5.6 Q16 Mac OSX

Posted: 2013-05-19T15:49:44-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.5-8 Beta available by sometime tomorrow. Thanks.

Re: possible bug -white-threshold IM 6.8.5.6 Q16 Mac OSX

Posted: 2013-05-25T18:48:01-07:00
by fmw42
Thanks. It is working fine in 6.8.5.8 Q16

Re: [RESOVED] possible bug -white-threshold IM 6.8.5.6 Q16

Posted: 2013-06-04T23:50:34-07:00
by anthony
I don't see anything wrong with -white-threshold or -black-threshold


However it is irrevent to the original problem, are the threshold colors was not supposed to to be set to white or block, but clipped to the threshold level (a gray).

this in some ways is better.

Adding something like this would on the other hand do the job!
-evaluate max 30%
and
-evaluate min 30%

That is (for 'max') if color value is less that 30% set it to 30%, the larger of the two values.

Actually I ould not be suprised if that works NOW, as 'max' is a statistical function for -evaluate-sequence


And what do you know -- it works!