The documentation for -threshold at http://www.imagemagick.org/script/comma ... #threshold says:
"If only a single 0 is provided, auto-thresholding will be performed."
Can someone tell me how auto-thresholding works or point me to the specific c code in the IM source code? When I do -threshold 0 all I get is a totally white image.
convert rose: -threshold 0 rose_auto_thresh.png
convert logo: -threshold 0 logo_auto_thresh.png
both result in a totally white image!!!
Also, while looking at the code in threshold.c, I see listed an A d a p t i v e T h r e s h o l d I m a g e, but I do not see any IM option at http://www.imagemagick.org/script/comma ... ptions.php for any such thing. What happened to this?
Thanks.
documentation question in -threshold IM 6.4.4.-6
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: documentation question in -threshold IM 6.4.4.-6
The manual is wrong. the command is right. Otherwise it makes it hard to seperate pure black pixels from non-black pixels.
See IM examples, Quantization, for reference to its proper behaviour.
See IM examples, Quantization, for reference to its proper behaviour.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: documentation question in -threshold IM 6.4.4.-6
anthony wrote:The manual is wrong. the command is right. Otherwise it makes it hard to seperate pure black pixels from non-black pixels.
See IM examples, Quantization, for reference to its proper behaviour.
OK, I have edited the documentation to remove the inaccurate line.
Also is there any autothresholding function and is there any adaptive thresholding function (there is code for the latter, but no option listed)?
Thanks
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: documentation question in -threshold IM 6.4.4.-6
One 'auto thresholding' method is to reduce the image to two colors without dither.
I look at this in IM examples, quantization, Two color quantization
http://www.imagemagick.org/Usage/quantize/#two_color
I look at this in IM examples, quantization, Two color quantization
http://www.imagemagick.org/Usage/quantize/#two_color
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: documentation question in -threshold IM 6.4.4.-6
How does -monochrome handle its thresholding? Does it dither? Either way, your approach with -colors 2 seems to produce a better result.anthony wrote:One 'auto thresholding' method is to reduce the image to two colors without dither.
I look at this in IM examples, quantization, Two color quantization
http://www.imagemagick.org/Usage/quantize/#two_color
The reason I am asking about auto thresholding is that I am looking into scripting some various approaches to see how they work.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: documentation question in -threshold IM 6.4.4.-6
-monocrome dithers always. It currently ignores the -dther setting.
It works by first grayscaling the image, then doing a two color gray colorspace quantization. See IM examples, Quantization
It works by first grayscaling the image, then doing a two color gray colorspace quantization. See IM examples, Quantization
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/