Extract L, a, and b channel from Tiff and store as grayscale

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
Franz777
Posts: 4
Joined: 2012-01-24T02:41:10-07:00
Authentication code: 8675308

Extract L, a, and b channel from Tiff and store as grayscale

Post by Franz777 »

Hi

I have a programm (Insight Toolkit ITK) which cannot read 16 bit TIFF data in general. The data is stored in Lab color space. ITK is able to read 16 bit png data so i like to convert it to a png which works, but imagemagick automatically convert the color channels to RGB which i do not want, so

- is there any way to suspress this behavour so that Red channel is L, Green is a and Blue is b from originall input image
- or, if not, is there a way to extract L, a and b and store them seperatelly as grayscale 16 bit png's

Thanks a lot
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Extract L, a, and b channel from Tiff and store as grays

Post by fmw42 »

try

convert image.tiff -separate -set colorspace Lab -combine -colorspace RGB image.png

or perhaps just

convert image.tiff -colorspace LAB -separate image_%d.png


see
http://www.imagemagick.org/Usage/color_basics/#separate
Franz777
Posts: 4
Joined: 2012-01-24T02:41:10-07:00
Authentication code: 8675308

Re: Extract L, a, and b channel from Tiff and store as grays

Post by Franz777 »

thanks a lot, i did not checked that there is also a -set colorspace option...
Post Reply