How do I use a colour to mask out pixels?
Posted: 2018-04-12T00:40:02-07:00
I want to mask out (ie, blacken) any pixels that have any blue in them. This is not the same thing as removing blue pixels. I've tested dozens of commands but can't achieve that yet. I've spent hours in the documentation and searching with Google.
Actually that's how I'm trying to solve my problem. My real problem, and perhaps there's a more direct solution, is that I want yellow pixels to be white and anything that isn't yellow to be black. But I realize yellow is Red + Green (two channels). So the idea of using blue as a mask is how I think I might achieve that, but perhaps that's the wrong way. If there is a more direct way to isolate the yellow that would be better. By yellow I define that to mean the Red channel >90% and the Green channel is also >90%.
Thanks in advance.
$ convert -version
Version: ImageMagick 7.0.7-15 Q16 x86_64 2017-12-14 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI
Delegates (built-in): bzlib freetype jng jpeg lcms png raw tiff webp xml zlib
Actually that's how I'm trying to solve my problem. My real problem, and perhaps there's a more direct solution, is that I want yellow pixels to be white and anything that isn't yellow to be black. But I realize yellow is Red + Green (two channels). So the idea of using blue as a mask is how I think I might achieve that, but perhaps that's the wrong way. If there is a more direct way to isolate the yellow that would be better. By yellow I define that to mean the Red channel >90% and the Green channel is also >90%.
Thanks in advance.
$ convert -version
Version: ImageMagick 7.0.7-15 Q16 x86_64 2017-12-14 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI
Delegates (built-in): bzlib freetype jng jpeg lcms png raw tiff webp xml zlib