Reputation: 71
I have a Image say 'X' (RGB) from which i want to get Image of RED Channel using Imagick I tried refering http://www.imagemagick.org/Usage/quantize
Upvotes: 6
Views: 5851
Reputation: 3669
The command you need can be found in the ImageMagick documentation at https://usage.imagemagick.org/color_basics/#separate:
Separating Channel Images
The easiest way separating out the individual color channels is to use the "-separate" operator to extract the current contents of each channel as a gray-scale image.
magick rose: -channel R -separate separate_red.gif magick rose: -channel G -separate separate_green.gif magick rose: -channel B -separate separate_blue.gif
In these examples, the rose:
parameter makes it use a small built-in image of a rose for the input. (Helpfully, you can see the redness of the rose shows up as lighter in the red channel.)
Upvotes: 7