Convert generate transparent image

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
juliusjueli
Posts: 2
Joined: 2013-12-05T14:44:28-07:00
Authentication code: 6789

Convert generate transparent image

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert generate transparent image

Post 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?
juliusjueli
Posts: 2
Joined: 2013-12-05T14:44:28-07:00
Authentication code: 6789

Re: Convert generate transparent image

Post 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?
Post Reply