Dennis Ich
Dennis Ich

Reputation: 3775

Imagemagick combine color channels

I have 3 raw pictures in 16 bit depth. These pictures have all the same size and should represent a color channel each. So I want 1 raw to be red one raw to be blue and the last to be green and put them together into a tif.

If I "lose" the 16 bit depth and just get 8 bit depth for each color at this step its ok but not preferred. If there is another tool where this is possible with I'm open for it.

Upvotes: 0

Views: 675

Answers (1)

Mark Setchell
Mark Setchell

Reputation: 207355

Kind of hard without the images, but something like this:

convert -depth 16 -size 800x600 gray:1.raw gray:3.raw gray:2.raw -combine -compress law image.tif

Specify the input files in the order R,G then B. I am assuming your red channel is in 1.raw, your green channel is in 3.raw and your blue channel is in 2.raw. Replace the filenames if not.

Set the size in the format widthxheight, and bit depth before reading.

Depending on the endianness of your data, you may need to put -endian msb or -endian lsb before you read in the files.

Specify -compress lzw to keep the output file small.

Upvotes: 1

Related Questions