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
im6819 convert -size 256x256 gradient: -white-threshold 50% -level 0x50% 1tmp2_6819.png
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
convert -size 256x256 gradient: -white-threshold 50% -level 0x50% 1tmp2_6856.png
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
im6819 convert -size 256x256 gradient: -white-threshold 50% 2tmp2_6819.png
6.8.5.6
convert -size 256x256 gradient: -black-threshold 50% 2tmp1_6856.png
convert -size 256x256 gradient: -white-threshold 50% 2tmp2_6856.png
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
im6819 convert -size 256x256 gradient: -white-threshold 50% 3tmp2_6819.png
6.8.5.6
convert -size 256x256 gradient: -black-threshold 50% 3tmp1_6856.png
convert -size 256x256 gradient: -white-threshold 50% 3tmp2_6856.png
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.
[RESOVED] possible bug -white-threshold IM 6.8.5.6 Q16
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
[RESOVED] possible bug -white-threshold IM 6.8.5.6 Q16
Last edited by fmw42 on 2013-05-25T18:48:32-07:00, edited 1 time in total.
Re: possible bug -white-threshold IM 6.8.5.6 Q16 Mac OSX
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.5-8 Beta available by sometime tomorrow. Thanks.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug -white-threshold IM 6.8.5.6 Q16 Mac OSX
Thanks. It is working fine in 6.8.5.8 Q16
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: [RESOVED] possible bug -white-threshold IM 6.8.5.6 Q16
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!
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!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/