overlay many pngs

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
phaethon100
Posts: 2
Joined: 2017-08-23T18:03:18-07:00
Authentication code: 1151

overlay many pngs

Post by phaethon100 »

Hi experts!

I have a script which creates pngs that i want to overlay.
With two pngs this works fine:

Code: Select all

convert -composite -compose Multiply lay_3.png   lay_4.png out.png 
No problem at all!

BUT
The problem is that with many pngs it doesnt work e.g. :

Code: Select all

 convert -composite -compose Multiply lay_1.png  lay_2.png lay_3.png   lay_4.png out.png
will only overlay the first 2 pngs.


Idealy I want something like:

Code: Select all

convert -composite -compose Multiply lay_*.png  out.png
to work, because some files e.g. lay_1.png and lay_3.png might be missing
How can it be done??
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: overlay many pngs

Post by fmw42 »

try

Code: Select all

convert lay_*.png -evaluate-sequence multiply out.png
See
http://www.imagemagick.org/script/comma ... e-sequence
phaethon100
Posts: 2
Joined: 2017-08-23T18:03:18-07:00
Authentication code: 1151

Re: overlay many pngs

Post by phaethon100 »

Thank you for your reply and time.

Your solution gave me a blank page, but somehow inspired me to find a solution doing:

Code: Select all

convert  lay_*.png  -compose multiply   -repage 1200x1200-1-1 -flatten out2.png
which for my case worked fine.

Cheers!
Post Reply