3

As part of a project, we need to programmatically combine multiple animated GIFs into one main animated GIF (one gif file), in the form of a grid.

We don't care if it is done on the client-side (i.e. a smartphone with ios/android), or on the server-side (i.e. php with Imagemagick). In either case, we do not want a gridview of separate gif files.

Is there any solution or suggestion on how this can be achieved?

Example:

Let's assume that we have a 4x4 grid (16 cells), with a different individual animated GIF image being shown in each cell; in such a way that each image is animating on its own. Therefore, creating a gif of 16 different videos/animations, all playing at the same time in 16 separate cells.

4
  • Use picasion.com ? Nov 15, 2013 at 1:22
  • @ElliottFrisch we need to perform this programmatically, and maybe this would be a good example of what I mean: youtu.be/ZKpFFD7aX3c?t=48s (spoiler alert if you haven't seen the matrix)
    – Sina
    Nov 15, 2013 at 1:32
  • Please update your question with the php (or other) code you've tried so far. Nov 15, 2013 at 1:38
  • I believe you haven't understood what I mean. so please don't downvote the question if you don't understand it. The problem is, how do you merge multiple animated images together in the same frame (say a 4x4 grid of gif images, all displaying different things at the same time).
    – Sina
    Nov 15, 2013 at 1:39

1 Answer 1

0

Based on your comments I believe that you'll need create 4-up representation of your images.

  1. Create a canvas (or similar - depending on implementation language) to become the frame,
  2. Every frame of your source(s) must then be spliced (or drawn) into one of a) top-left, b) top-right, c) bottom-left, d) bottom-right,
  3. Save each frame to a new image (at 4 times the resolution and composed as in step (2),
  4. Combine those frames created in step (3) into a new image as in any animated format.

Or use html to create a web page and render the 4 images as in Step (2) above.

2
  • Thanks a lot for the answer. This is the solution that I had in mind myself, but I have considered it as a last resort. Especially since the frame rate of the gifs may differ, and requiring lots of computing resources. If I want to start skipping frames, I may also lose focused frames. I am mainly looking to see if there might be an easier solution/library to achieve this.
    – Sina
    Nov 15, 2013 at 1:55
  • GIFs don't really have a high frame rate; and you could reset that on your input files. There is software (e.g. ImageMagick) to extract each frame. But you'll have to re-assemble them into your movie. Or buy some commercial video editing software. Nov 15, 2013 at 6:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.