4

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

Jalpa Bhavsar
  • 51
  • 2
  • 3

1 Answers1

5

The command you need can be found in the ImageMagick documentation at https://www.imagemagick.org/Usage/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.

convert rose: -channel R -separate separate_red.gif
convert rose: -channel G -separate separate_green.gif
convert rose: -channel B -separate separate_blue.gif

Rose ==> Rose Red Rose Green Rose Blue

(In these examples, the rose: parameter makes it use a small built-in image of a rose for the input.)

mwfearnley
  • 3,303
  • 2
  • 34
  • 35