PerlMagick

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PerlMagick

Post by anthony »

Compose images only composes TWO IMAGES. That is ALL.
You will need to loop though all the frames of the animation, coalescing the background into each frame.

NOTE the wording of the above. The final image size, and animation meta-data (frame delay) in a composition will come from the 'destination' image, and not the src image! As such I recommend
you composite the 'background' image 'under' (DstOver) each 'frame' (as the destination image), so you do not lose the time delay.

But before you do that I suggest you coalesce the two animations (separatally before appending the frame sequence). This will remove any and all GIF frame optimization that may be present, making sure each and every 'frame' is the complete image that is to be displayed at that point.

For the command line, I wrote a -layers composite program that does the loop, either with two lists of images, or a list of images and a single static image. The static image can be either destination, or source for the composition, and it completes the job by transfering animation meta-data from the 'list' to the resulting 'list' regardless of which was which.
Though the final size will still come from the 'destination' side.

This is availavel via the Layers() call, though I have not tried this myself.

See IM Examples, Animation Modifications,
http://www.imagemagick.org/Usage/anim_mods/#composite

Also see the other animation composition examples later on that same page.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply