Staaarter

GIF Resizer

Decodes an animated GIF's frames and resamples each one to an exact target width and height using nearest-neighbor interpolation, optionally locking the aspect ratio, then re-encodes the resized animation. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-29
By Staaarter Team
editortransformanimationgif

Overview

Introduction

Resizing an animated GIF to an exact pixel size, for embedding in a specific layout, meeting a platform's size limits, or just matching another asset, means resampling every frame consistently.

This tool decodes each frame, resizes it to your target dimensions, and re-encodes a new animated GIF, entirely in your browser.

What Is GIF Resizer?

A client-side tool that resamples every frame of an animated GIF to an exact target width and height using nearest-neighbor interpolation, with an optional aspect-ratio lock that derives the height automatically from the width and the source's own proportions.

It builds on this category's shared resizing helper, the same one gif-enlarger, gif-shrinker, and gif-upscaler use.

How GIF Resizer Works

For each output pixel, the tool maps back to the nearest corresponding source pixel using simple width/height ratios, copying that pixel's exact color rather than blending neighboring pixels.

This runs once per decoded frame at the same target dimensions, so every re-encoded frame ends up the same size, satisfying the shared GIF encoder's one-canvas-size-per-file requirement.

When To Use GIF Resizer

Use it when you need an animated GIF at an exact pixel size, like a specific banner or thumbnail dimension.

Turn on aspect-ratio lock when you only care about one dimension (usually width) and want the other computed automatically to avoid stretching.

Features

Advantages

  • Gives exact, predictable output dimensions rather than a relative percentage scale.
  • Optional aspect-ratio lock prevents accidental stretching when you only mean to change one dimension.
  • Runs entirely client-side; nothing you upload leaves your browser.

Limitations

  • Nearest-neighbor resampling can look blocky on large size increases and can lose fine detail on large decreases; for smoother large decreases, gif-downscaler's area-averaging may look better.
  • Without aspect-ratio lock, mismatched width/height inputs will visibly stretch or squash the animation.

Examples

Resizing to an exact banner size with aspect lock

Input

A 400x300 animated GIF, target width = 600, aspect ratio locked

Output

A 600x450 animated GIF (height computed automatically to preserve the 4:3 ratio)

With aspect-ratio lock on, only the width is taken as entered; the height is derived from the source's own 400:300 ratio, avoiding any stretching.

Best Practices & Notes

Best Practices

  • Turn on aspect-ratio lock unless you specifically want to stretch or squash the animation to fit a fixed non-proportional box.
  • For large reductions in size, compare the result against gif-downscaler's area-averaged output to see which looks better for your source content.
  • Resize before cropping if you want a specific final pixel size with room to trim afterward.

Developer Notes

resizeGif in gif-resizer.ts wraps the shared resizeNearest helper (from png/lib/shared/pixel-buffer.ts) applied per decoded GIF frame via transformGifFrames, mirroring png-resizer.ts's own thin-wrapper structure. The aspect-ratio-lock branch recomputes height from the per-frame context's source width/height ratio rather than a value the caller supplies, so it can't drift from the actual source proportions.

GIF Resizer Use Cases

  • Resizing an animated GIF to fit a specific banner, thumbnail, or embed size
  • Matching an animated GIF's dimensions to another fixed-size asset in a layout
  • Producing a smaller or larger exact-dimension variant for a size-constrained platform

Common Mistakes

  • Entering mismatched width/height values without aspect-ratio lock and getting an unintentionally stretched or squashed result.
  • Expecting nearest-neighbor resizing to look as smooth as a photo-editing tool's bicubic resize; it deliberately keeps hard edges rather than blurring them.

Tips

  • If you only know the width you need, aspect-ratio lock saves you from calculating the matching height by hand.
  • For a contain-fit into a box with letterboxing instead of exact-dimension resizing, use gif-rectangle-fitter.

References

Frequently Asked Questions