How to put different files into different channels of a file

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
test84

How to put different files into different channels of a file

Post by test84 »

Hi,
I'm trying to put different channels of different files into channels of a single file. To make myself more clear, I'm trying to read specular, normal maps and such things which are located on channels of various files and put them in R, G, B and Alpha channel of a single file.

Any ideas on how to do that?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to put different files into different channels of a file

Post by fmw42 »

convert \( image1 -channel blue -separate \) \
\( image2 -channel red -separate \) \
\( image3 -channel green -separate \) \
\( image4 -channel red -separate \) \
-channel rgba -combine \
newimage.png

choose whatever channels you want in the above from each image
test84

Re: How to put different files into different channels of a file

Post by test84 »

Thank you man.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to put different files into different channels of a file

Post by anthony »

See IM examples, Channels and Masks
http://www.imagemagick.org/Usage/channels/

This looks at a lot of different methods of extracting and re-combining channel images.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply