Stack multiple images in semitransparent layers with imagemagick? -


what simple way stack multiple (~ 10) png images layers same transparency that's less 100% using 1 or 2 imagemagick commands?

the source images same size , not transparent.

i tried several variants of this:

composite -dissolve 50 in1.png in2.png -alpha set out.png

the best 1 image stacked semintransparent against solid. no success wildcards. i'm casual user of imagemagick. guess write script or simple program want multiple images, there may simple way in imagemagick already, , that's i'm hoping find.

modifying images okay, e.g. setting alpha value using command takes wildcard , stacking them.

there several ways in imagemagick, depending upon trying achieve. using version 6.9.9.12 q16 mac osx.

i have corrected commands fix typo in arguments of third example , included xenoid's suggested weights make first example below become equivalent other 2 each result same averaging images.

input image:

enter image description here

enter image description here

enter image description here

method 1: using alpha channel

convert checks.jpg \( lena2.jpg -alpha set -channel alpha -evaluate multiply 0.5 \) \( zelda3.jpg -alpha set -channel alpha -evaluate multiply 0.3333 \) -flatten result0.png 

enter image description here

method 2: equal averaging (-evaluate-sequence mean)

convert checks.jpg lena2.jpg zelda3.jpg -evaluate-sequence mean result1.png 

enter image description here

method 3: weighted averaging (-poly)

convert checks.jpg lena2.jpg zelda3.jpg -poly "0.33333,1 0.33333,1 0.33333,1" result2.png 

the first number of pair weight , second number exponent, here 1. value of 2 weight squares.

enter image description here


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -