Reputation: 942
I've got two tiff stacks with time-lapse data corresponding to different channels acquired in a microscopy experiment. I'd like to merge them into a single stack with two channels. Both stacks are 16-bit greyscale.
When I use:
convert stack1.tiff stack2.tiff stack_merged.tiff
I get a single but concatenated file with two stacks one after another.
Upvotes: 3
Views: 1413
Reputation: 208052
I think you need something like this:
#!/bin/bash
# Get index of last frame in TIFF image
last=$(convert stack1.tif -print "%[fx:n-1]" null:)
# Combine all frames
for i in `seq 0 $last`; do
convert stack1.tif[$i] stack2.tif[$i] -combine miff:-
done | convert miff:- -compress lzw result.tif
Upvotes: 2