Page 1 of 1

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

Posted: 2012-01-24T02:49:41-07:00
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

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

Posted: 2012-01-24T12:17:14-07:00
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

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

Posted: 2012-01-24T23:41:56-07:00
by Franz777
thanks a lot, i did not checked that there is also a -set colorspace option...