Easily blend multiple images?

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
fracai

Easily blend multiple images?

Post by fracai »

I have several (hundreds) of images that I'd like to average together equally. I know I can do this two images at a time using a shifting blend argument ranging from 1 to 100.
A first attempt over 132 images went something like the following (merge.jpg starts out as a blank page):

Code: Select all

for P in input/*.jpg ; do C=$[C+1]; B=$[C*100/132]; composite -blend $B merge.jpg "$P" -matte merge.jpg ; done
Ideally I'd run IM in one shot to avoid having to specify the total number of images and, hopefully, more equally weight each image.

Any tips?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Easily blend multiple images?

Post by fmw42 »

convert image1 image2 image3 image4 ... imageN -evaluate-sequence mean averageresult

will average all images together

see sequential formula at viewtopic.php?f=3&t=16143
fracai

Re: Easily blend multiple images?

Post by fracai »

Excellent! Thanks very much.
Post Reply