Gif images are a different beast than regular images. They are encapsulated “programs” which run and animate an image. They cannot simply be “cropped” down to a new size because each frame must be “cropped”. Often times, GIFs are even smart enough to compress themselves so that only parts of the image are animated to make them smaller.
As such, they do not fit into the regular flow of Blitline. They must be handled specially, or they will just be output as static single files (usually the first image in the GIF).
Animated GIFs must be specified with a “src_type” : “gif”, and the function that operates on the gif must be specified in the “src_data” element:
There are 3 operation we support for manipulating GIFs, you can find examples below.
Resize Gif to Fit
Forces a GIF to fit the particular dimensions, resizing the largest side to fit within the specified “width” or “height” while maintaining aspect.
Overlays an image onto an animated gif.
Convert GIF to video file
Will take an animated GIF and turn it into an mp4 video.
You MUST provide an S3 Destination for gif_to_vid functionality.