Page 1 of 1

Convert generate transparent image

Posted: 2013-12-05T14:50:48-07:00
by juliusjueli
I have several png images and I wanna to merge them together by using convert command.
The following command line gives me a transparent image.
convert *.png -evaluate-sequence mean merged_image.png

If I use median or max instead of 'mean', there is a non-transparent image. But 'min' and 'mean' will generate transparent image.
My system is ubuntu 12.04 64 bit

Re: Convert generate transparent image

Posted: 2013-12-05T15:17:50-07:00
by fmw42
Perhaps you should post links to your images and explain how it is that you want them merged? If the images have alpha channels, then how do you want them merged.

try adding -alpha on -channel rgba after reading the images and see if that helps.

Or try just doing

convert *.png -background none -flatten result.png


what is your version of Imagemagick?

Re: Convert generate transparent image

Posted: 2013-12-06T00:14:45-07:00
by juliusjueli
Thanks Fred, your reply is very helpful.

Following your instructions, I did these things to make it work.
1. my previous version was too old, the default one from Ubuntu
2. I installed the new version according to the line: http://www.imagemagick.org/script/insta ... e.php#unix
but there are two fails during the 'make check' testing.
3. After searching the solution for a while, I run the following two command lines
sudo apt-get install build-essential checkinstall && sudo apt-get build-dep imagemagick
then, reinstall Imagemagick. It passed all the checking and no fails any more
4. I used the following command line to merge my images, stacking multiple images to reduce noise
convert *.png -evaluate-sequence mean result_mean.png (the result is a transparent image with a little bit color)
convert *.png -alpha on -evaluate-sequence mean result_mean.png (I got a transparent image)
convert *.png -alpha off -evaluate-sequence mean result_mean.png (I got what I need ^=^)
fmw42 wrote:Perhaps you should post links to your images and explain how it is that you want them merged? If the images have alpha channels, then how do you want them merged.

try adding -alpha on -channel rgba after reading the images and see if that helps.

Or try just doing

convert *.png -background none -flatten result.png


what is your version of Imagemagick?