I have a 16-bit depth tif image with 4 channels (each channel is 16-bit).
"identify" says it's a sRGB image. No problem till here.
Theses channels are "automatically" detected by image software like Photoshop as RGBA, in this precise order. It's natural to all conventional images.
But in fact my image isn't conventional ; its channels are : infrared(IR),R,G,B. In this order. It was acquired by a special camera.
So the image looks red on theses software because all channels are shifted : IR becomes red (it's the brighter channel), red becomes green, green -> blue, and blue -> A (so is lost as a color).
The basic idea is to use IM to extract the channels 2,3 and 4 which correspond respectively to R,G and B (the channel 1 is the IR channel).
And recombine these 3 only in a new RGB image to have a "normal" image corresponding to the reality, as perceived by our eyes.
(or much better, a RGB"IR" as a RGBA. Thus "cheating" the softwares by placing the IR channel at the last position instead of the first one).
I'm using this for the moment :
(following these indications : http://www.imagemagick.org/script/comma ... hp#channel )
Code: Select all
convert image.tif -channel ARGB -separate channels_%d.tif
(channels_0.tif is infrared)
Code: Select all
convert channels_1.tif channels_2.tif channels_3.tif -channel RGB -combine image_recombined.tif
First, the original image weights X Mo.
All 4 separated channels images weight a lot less than X/4 Mo each. it's really strange !
And of course, the recombined image, weights a lot less (~half) than the original image.
This is unfortunately visible ; I feel I'm having a highly compressed JPG image on my eyes. Theres is some "flat color zones" and a high loss of details. I precise I'm working with *.tif images only. I do not applied any other commands as the ones shown here.
Am I doing something wrong ?
Any help appreciated, thanks a lot !
( I'm using this version of IM on Windows 7: ImageMagick-7.0.3-0-portable-Q16-x86.zip from here: ftp://ftp.imagemagick.org/pub/ImageMagick/binaries/ )