png to red/green/blue to tiff

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-24T10:23:12-07:00
Authentication code: 67789

png to red/green/blue to tiff

Post 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?
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: png to red/green/blue to tiff

Post 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".
Post Reply