Page 1 of 1

png to red/green/blue to tiff

Posted: 2017-08-14T14:19:07-07:00
by clownpleco
I need to convert a png file to 3 separate uncompressed tiff files that contain the red,green or blue values. The tiff files have to be 8 bit. Suggestions?

Re: png to red/green/blue to tiff

Posted: 2017-08-14T15:22:04-07:00
by GeeMack
clownpleco wrote: 2017-08-14T14:19:07-07:00I need to convert a png file to 3 separate uncompressed tiff files that contain the red,green or blue values. The tiff files have to be 8 bit. Suggestions?
You should always provide the version of ImageMagick you're using and what platform you're running it on, and maybe include the commands you've tried already. There are several ways to do most IM tasks, and you'll get better help if you give as much detail as you can.

So without knowing any more about it, at the simplest, from a command prompt on most *nix or Windows systems it can be done with a command like this...

Code: Select all

convert input.png -separate -compress none -depth 8 out-%02d.tif
That should produce three TIF images, one each from the red, green, and blue channels of the input image. The results are 8 bit gray, and have names like "out-00.tif", "out-01.tif", and "out-02.tif". If you're using IM7 use "magick" instead of "convert".