imgix APIsRendering APIAnimation

Animation

Premium Feature

Animated GIF functionality is currently available for imgix customers on our Premium plans. If you’re interested in this feature, contact our sales team to get more information on this feature.

Animation of imgix logo

These parameters allow you to control the animation and quality of your GIFs.

Performance Warning

Extremely large GIFs or GIFs with a large number of frames may time out depending on the size of the file. If you’re experiencing issues with large GIFs, contact support.

Video Conversion

In spite of the compression options available, you may find that you need even smaller file sizes or need to be able to stream GIF content (for example, if your app or site is generally accessed via mobile). In this case, converting GIFs to video (MP4 or WebM) can take care of both issues.

All other parameters are applied before conversion, so you can get your masterpiece exactly the way you want it and make it a video by adding fm=mp4 or fm=webm to the URL. Either format will compress the content and enable streaming to increase both perceived and actual load speed. The example below shows the size savings from the original.

Original GIF, 713kB
sandbox-demo
fm=mp4, 361kB
fm=webm, 550kB

Videos can be set to autoplay and loop like GIFs, but because they are not images, they must be requested using the <video> tag and the controls are applied there. The code below was used to generate the example above, and if you want more information about the available <video> controls, here’s a quick guide.

Please note: as of April 2018, due to Chrome’s autoplay policy changes, muted is required in the <video> tag for autoplay in Chrome browsers.

<video autoplay loop muted>
  <source
    src="https://gif.imgix.net/cartoon-fight.gif?fm=mp4&sepia=50"
    type="video/mp4"
  />
</video>