Creating a montage of only the alpha channel
Posted: 2012-11-06T09:16:42-07:00
Hi,
I have a series of png images with transparency that I would like to have a montage of. The thing is, I only want the alpha channel, and AS an alpha channel. The rest of channels (R,G and B) can be any solid color.
The way I have come so far is to do it in three steps.
First I mount the series as a grayscale of the alpha:
montage -alpha Extract [series...] alpha_grayscale.png
Then I create an empty canvas, solid color:
convert -size [w and h of my spritsheet] canvas:red canvas.png
And then I push the alpha in that solid image:
convert canvas.png alpha_grayscale.png +matte -compose CopyOpacity -composite PNG32:alpha.png
What I want to know is if it is possible to do all that in a single montage command.
I've played with the -compose option a little bit, but I did not succeed. In fact it is unclear to me what the options in the montage command apply to. If I want to do a png with image as well as alpha (so 32 bits), I have to set -background none, otherwise there won't be any transparency in the montage. Like so:
montage -alpha Set -background none [series...] PNG32:montage_with_alpha.png
The -background option seems to apply to the canvas that's created for the spritesheet. But then, in my specific case, I want a solid color canvas with a transparency channel, so what do I do?
I also thought that the -channel options would let me choose which channels I want to use and copy in the final composition, but it does not seem to do that. In fact, from the documentation, I never understood what the channel option does. It says that it determines what channels the subsequent operation apply to, but what these subsequent operations might be eludes me.
Thank you for your help!
I have a series of png images with transparency that I would like to have a montage of. The thing is, I only want the alpha channel, and AS an alpha channel. The rest of channels (R,G and B) can be any solid color.
The way I have come so far is to do it in three steps.
First I mount the series as a grayscale of the alpha:
montage -alpha Extract [series...] alpha_grayscale.png
Then I create an empty canvas, solid color:
convert -size [w and h of my spritsheet] canvas:red canvas.png
And then I push the alpha in that solid image:
convert canvas.png alpha_grayscale.png +matte -compose CopyOpacity -composite PNG32:alpha.png
What I want to know is if it is possible to do all that in a single montage command.
I've played with the -compose option a little bit, but I did not succeed. In fact it is unclear to me what the options in the montage command apply to. If I want to do a png with image as well as alpha (so 32 bits), I have to set -background none, otherwise there won't be any transparency in the montage. Like so:
montage -alpha Set -background none [series...] PNG32:montage_with_alpha.png
The -background option seems to apply to the canvas that's created for the spritesheet. But then, in my specific case, I want a solid color canvas with a transparency channel, so what do I do?
I also thought that the -channel options would let me choose which channels I want to use and copy in the final composition, but it does not seem to do that. In fact, from the documentation, I never understood what the channel option does. It says that it determines what channels the subsequent operation apply to, but what these subsequent operations might be eludes me.
Thank you for your help!