2

I'm writing a little program in C/C++ to convert gifs to a single image, where the frames are consecutive in a single image. Unfortunately, I am running out of free time, and I want to use the program sooner than I might be done with it. So I am wondering, is this functionality existent in imagemagick?

Can I take a set of images and convert them to one image? Not like an animated gif, but like a series of frames within one image.

  • 1
    The relevant imagemagick tool would be montage I think – steeldriver Apr 26 '18 at 18:12
  • I'll check it out, I just came across append, which stacks the images vertically. – j0h Apr 26 '18 at 18:50
  • montage almost works, but after 12 images, it starts a new line. I need to keep all the frames on one line. how do I do that? – j0h Apr 26 '18 at 20:06
0

ok i figured it out. you can do this: $convert a.gif a.png this will give you a series of images a-1.png, a-2.png, a-n.png .... and so on. then, you can do this: convert +append a-*.png out.png

This will give you a horizontal sprite sheet instead of a vertical one, in out.png. A single line of code my be possible, I have like 0 extra time to figure it out though.

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.