convert jpg to RGB components

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
clownpleco
Posts: 6
Joined: 2012-09-24T17:23:12+00:00
Authentication code: 67789

convert jpg to RGB components

Post by clownpleco »

I have jpg files and want to create single red, green and blue gray shade images. Is this possible?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: convert jpg to RGB components

Post by fmw42 »

I am not sure what you mean. If you mean to separate the RGB channels from the image, then

Code: Select all

convert image.jpg -separate channel.png
The result will be channel-0.png for red, channel-1.png for green and channel-2.png for blue.

Or

Code: Select all

convert image.jpg -channel r -separate red.png
convert image.jpg -channel g -separate green.png
convert image.jpg -channel b -separate blue.png
See
https://imagemagick.org/script/command- ... p#separate
https://imagemagick.org/Usage/color_basics/#separate
Post Reply