solved: misunderstand -threshold IM 6.4.4.-4

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

solved: misunderstand -threshold IM 6.4.4.-4

Post by fmw42 »

IM 6.4.4.-4 Q16 Mac OSX Tiger

I am having a problem getting a b/w only image (no color showing) when thresholding a single channel image. Either there is a bug or I do not understand something. Please correct me about my misconception if this is not a bug.


These two give a pure b/w only result:
convert rose: -threshold 50% rose_thresh50.png
convert rose: -colorspace gray -threshold 50% rose_gray_thresh50.png

But these two results still show some color in them and are not pure b/w:
convert rose: -channel G -separate -threshold 50% rose_green_thresh50.png
convert rose: -channel G -separate -colorspace gray -threshold 50% rose_green_gray_thresh50.png


Am I doing something wrong? How do I go about separating one channel from an image and thresholding it?

OK. I solved it. I need to turn back on all the channels as in:

convert rose: -channel G -separate -channel RGB -threshold 50% rose_green_rgb_thresh50.png
Post Reply