Page 1 of 1

Blend Animation with image

Posted: 2016-02-23T07:21:41-07:00
by dognose
I'm trying to blend a pattern onto an animtion

For a single frame, it works great,

composite -blend 50x50 frame.jpg pattern.jpg out.jpg

But, if I use an animated gif, it gets flattened.

I've looked into -layers Composite, but it just overlays it without any blending.

Is there anyway to blend an animation without having to disassemble the animation?

Re: Blend Animation with image

Posted: 2016-02-23T09:56:47-07:00
by snibgo
IM works on individual images, not animations. An animation is always disassembled before processing.

Without seeing your images, advice is difficult, but:

1. You probably need "-layers coalesce" to make complete individual frames from the input animation.
2. You might want "-layers optimize" at the end.
3. To composite an individual image with each of the animation frames, you probably want a "NULL:" between the frames and image, then "-layers composite".
4. To get a compose other than the default "over", you need a "-compose something".

See http://www.imagemagick.org/script/comma ... php#layers
See also the animation pages linked from http://www.imagemagick.org/Usage/

Re: Blend Animation with image

Posted: 2016-02-23T10:18:46-07:00
by dognose
Is there a compose operator that does blending? I've studied all the examples. NONE of the animation examples involve blending.

I'm trying to make a generic function here that works for any animation, so deconstructing the animation is problematic.

Maybe there is a script here that efficiently deconstructs an animation, acts on each frame, then reassembles the animation?
(frame timing, looping, offsets need to be maintained)

Re: Blend Animation with image

Posted: 2016-02-23T10:21:15-07:00
by dognose
Some operators work fine with animations, some do not.

Re: Blend Animation with image

Posted: 2016-02-23T10:46:19-07:00
by fmw42
Best I can suggest is to use -coalesce. Also see http://www.imagemagick.org/Usage/anim_mods/#composite

Re: Blend Animation with image

Posted: 2016-02-23T10:48:47-07:00
by snibgo
dognose wrote:Is there a compose operator that does blending?
"convert -list compose" lists the available compose options. Near the top, you should find "Blend". Use it with, for example, "-define compose:args=25" for a 25% blend.