GIF and animation guides

Fit an animated GIF to a square canvas

·

A small animated graphic needs to fit a square slot. Compare a proportional resize and a square with padding so you can keep the whole animation visible.

Resize GIF

Scale the original animation by half

Open Resize GIF and choose Load example. The input measures 64 × 40. Keep Scale by percentage at 50%. The plan reads 32 × 20.

Choose Resize GIF and play the result. All four frames still run in the same order. Download gif-utility-sample-32x20.gif if you need the smaller version.

Download the original four-frame practice GIFImageMagick animation examples, modifying and resizing GIFs

Fit the animation inside a 64 × 64 square

Choose Width and height and enter 64 in both fields. Select Fit with padding and leave Transparent padding selected. Resize the GIF again.

The 64 × 40 content sits in the center with 12 pixels above and below. To use all 64 pixels of height, choose Crop to fill and check for clipped edges. Stretch to fit changes proportions to cover the square.

Download the original four-frame practice GIFImageMagick animation examples, modifying and resizing GIFs

Check dimensions and playback in the download

Download gif-utility-sample-64x64.gif. Open it in an image viewer and check the transparent padding, the four frames and the three total plays.

The stored delays are 30, 110, 240 and 80 ms. GIF has a limited palette and uses opaque or transparent pixels, so check small lettering and soft edges after you resize your own animation.

Download the original four-frame practice GIFW3C copy of the GIF89a specification

Common questions

Will my GIF play at a different speed?

The tool preserves the stored delay of every frame and the source loop setting.

Can I use a colored mat around a transparent GIF?

Choose Fit with padding, turn off Transparent padding and set its color. The mat fills the space around the centered frame.

Sources

Put it into practice.

Related guides