Merge RGB from 3 monochrome channels


(Lennart) #1

Hello!

I do have 3 8bit grayscale images and would like to combine them into a single RGB image and display it.

currently I just use
gmic 0.bmp 1.bmp 2.bmp
just do load the images.

As far as I understood the next step would be to built a stack using
-append
or to use the
-blend
command.

But so far I did not manage to use either of them.

  • Lennart

(Karsten R) #2

gmic 0.bmp 1.bmp 2.bmp -a c
would do it!


(Karsten R) #3

I forgot, if your images are read in as RGB images, you could do
gmic *.bmp -luminance -a c
or
gmic *.bmp -to_gray -a c


(Lennart) #4

KaRo, Thank you very much!

I tried
gmic 0.bmp 1.bmp 2.bmp -to_gray -a c
and it worked!

From the documentation i read -a is same as append.
-a c would then mean append along the ‘c’ or spectrum axis

‘spectrum’, the number of image channels (size along the ‘c’-axis).
(the spectrum is respectively equal to 3 and 4 for usual RGB and RGBA color images).

I did play a bit around using the -print command at various position to see the number of bands vary. Without the -to_gray-command the final image really does have 9 bands on the spectrum axis and each 8bit monochrome image is read as 3 band color image.