In G’MIC command line (cli
), split will array all the channels into a series of single channel grayscales. append then can pull them back together after you rearrange your channels as you see fit.
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input all frames of TIFF file 'output-alpha2.tif' at position 0 (1 image 4096x4096x1x5).
[gmic]-1./ Split image [0] along the 'c'-axis.
[gmic]-5./ Display images [0,1,2,3,4] = 'output-alpha2.tif, (...), output-alpha2_c4.tif'.
[0] = 'output-alpha2.tif':
size = (4096,4096,1,1) [64 Mio of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 65535, mean = 41.4099, std = 1435.78, coords_min = (0,0,0,0), coords_max = (1398,1651,0,0).
[1] = 'output-alpha2_c1.tif':
size = (4096,4096,1,1) [64 Mio of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 57311, mean = 32.2771, std = 1133.41, coords_min = (0,0,0,0), coords_max = (1961,1107,0,0).
[2] = 'output-alpha2_c2.tif':
size = (4096,4096,1,1) [64 Mio of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 57311, mean = 35.9718, std = 1265.64, coords_min = (0,0,0,0), coords_max = (1961,1107,0,0).
[3] = 'output-alpha2_c3.tif':
size = (4096,4096,1,1) [64 Mio of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 65535, mean = 13899.9, std = 26784.6, coords_min = (0,0,0,0), coords_max = (1962,1108,0,0).
[4] = 'output-alpha2_c4.tif':
size = (4096,4096,1,1) [64 Mio of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 65535, mean = 13899.9, std = 26784.6, coords_min = (0,0,0,0), coords_max = (1962,1108,0,0).
Your two trailing alpha channels appear to be identical, so their ordering as a pair seems moot. Subtracting one alpha channel from the other leaves a zero-ed out image (Note image metrics in G’MIC’s shell log).
gosgood@bertha ~/Downloads $ gmic output-alpha2.tif split. c sub[-2,-1] keep.
[gmic]-0./ Start G'MIC interpreter.
[gmic]-0./ Input all frames of TIFF file 'output-alpha2.tif' at position 0 (1 image 4096x4096x1x5).
[gmic]-1./ Split image [0] along the 'c'-axis.
[gmic]-5./ Subtract images [3,4].
[gmic]-4./ Keep image [3] (1 image left).
[gmic]-1./ Display image [0] = 'output-alpha2_c3.tif'.
[0] = 'output-alpha2_c3.tif':
size = (4096,4096,1,1) [64 Mio of float32].
data = (0,0,0,0,0,0,0,0,0,0,0,0,(...),0,0,0,0,0,0,0,0,0,0,0,0).
min = 0, max = 0, mean = 0, std = 0, coords_min = (0,0,0,0), coords_max = (0,0,0,0).
Of course, with G’MIC cli
you may order these channels in any permutation you desire. reverse and move are your friends. Your workflow roughly would go along the line of splitting along channels, rearranging the image list, perhaps inputting new channels, then appending back together to obtain an image with rearranged channels.
I can’t recommend another software package that affords this degree of image manipulation.
What are you hoping to achieve?
And — welcome to the board! Enjoy your stay.