LAB channels don't behave during threshold
Posted: 2015-02-26T08:43:20-07:00
I'm having trouble getting the result I want while using ImageMagick 6.8.9-5 Q16 x64 on Windows 7 64bit via Cygwin.
I want to take an input image, convert it to LAB colorspace, apply a threshold on the 'A' channel, and output this as a grayscale (more specifically black&white, as a threshold should be). I am using the following line:
The result I get is not grayscale at all, but rather a 'greenscale' with 126 colours (according to identify), rather than the 2 I'm expecting. I've tried using this line:
to zero channels L and B (i.e. R and B) as explained in the online documentation, but that's still an awful green mess. Can someone explain where I'm going wrong please?
I want to take an input image, convert it to LAB colorspace, apply a threshold on the 'A' channel, and output this as a grayscale (more specifically black&white, as a threshold should be). I am using the following line:
Code: Select all
convert input.png -colorspace lab -channel G -separate -threshold 50% +channel ouput.png
Code: Select all
convert input.png -colorspace lab -channel G -separate -threshold 50% -channel RB -evaluate set 0 +channel output.png