Script to average 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?".
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Script to average images

Post by anthony »

Woody wrote:ahhh thank you!

OK, follow on question: can ImageMagick weight the images i.e. the highest numbered contributes say 50%, then the next 25%, then 12.5%, and then 2 lots of 6.25% (i.e. to give 100%) ?

You are taking about weighted avergeing, which is also 'blending'.
http://www.imagemagick.org/Usage/compose/#blend
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Script to average images

Post by fmw42 »

anthony wrote:
Woody wrote:ahhh thank you!

OK, follow on question: can ImageMagick weight the images i.e. the highest numbered contributes say 50%, then the next 25%, then 12.5%, and then 2 lots of 6.25% (i.e. to give 100%) ?

You are taking about weighted avergeing, which is also 'blending'.
http://www.imagemagick.org/Usage/compose/#blend
But you are limited to two images at a time for blending. Is that not correct? There is no arbitrary number of images with weights function.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Script to average images

Post by anthony »

fmw42 wrote:But you are limited to two images at a time for blending. Is that not correct? There is no arbitrary number of images with weights function.
True, but when you come down to it, any method can be de-composed to a sequence of two values at a time!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Script to average images

Post by fmw42 »

anthony wrote:
fmw42 wrote:But you are limited to two images at a time for blending. Is that not correct? There is no arbitrary number of images with weights function.
True, but when you come down to it, any method can be de-composed to a sequence of two values at a time!
True, but then you need to do some calculations to do running averaging rather than average all images at once. I posted a script earlier in this topic to show how to do the running average without weights, when you have too many images to do all at once. I have not tried to do that with weights yet.
Woody
Posts: 8
Joined: 2012-06-24T20:47:59-07:00
Authentication code: 13

Re: Script to average images

Post by Woody »

So, the work is done!

Basically I've been playing around with TimeLapse movie on my Android phone, which with ICS is really easy.

Thing is that there's no ability to "drag" the shutter, so I thought maybe I could use ImageMagick to average some frames, and give a similar effect.

Turns out, you can get some nice results, and a handy side benefit is that you can separate the "drag" duration from your framerate ie you can average 3 seconds of frames, and have 1 frame per second in your movie.

Here's a howto: http://www.hutsby.net/2012/07/making-ti ... gging.html

and some sample movies with different drags and timelapse:

http://www.youtube.com/watch?v=fPVumZ3z72Q
http://www.youtube.com/watch?v=FMgPPp81gOA
http://www.youtube.com/watch?v=nSRcs2jeWLs

Many thanks to the assistance I got!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Script to average images

Post by fmw42 »

Very nice! Thanks for sharing.
Post Reply