Staaarter

GIF Border Remover

Uploads an animated GIF, decodes every frame, and crops a chosen pixel thickness off every edge of each frame, shrinking every frame's canvas identically so the animation keeps playing in sync, then re-encodes and downloads the trimmed GIF. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-29
By Staaarter Team
editorborderanimationcanvasgifcrop

Overview

Introduction

This tool crops a fixed-thickness border off every frame of an animated GIF, entirely client-side, shrinking every frame's canvas by the same amount on all four sides.

It's the direct inverse of the GIF Border Adder tool, useful for trimming a frame, letterboxing strip, or padding margin that got baked into a source animation.

What Is GIF Border Remover?

A client-side GIF cropping tool that decodes an uploaded animation into its individual composited frames, crops a chosen pixel thickness off every edge of each one, and re-encodes the result as a new animated GIF with the same frame count, order, and delays.

Because every frame is cropped by an identical amount, the animation's content stays perfectly aligned across frames after cropping.

How GIF Border Remover Works

The GIF is decoded frame-by-frame into flat RGBA pixel buffers using this site's shared GIF codec, then each frame's pixels are copied into a new, smaller canvas offset by the crop thickness on the left and top (and simply sized smaller on the right and bottom).

The cropped frames are re-encoded into a single animated GIF, keeping each frame's original delay and the source's loop count.

When To Use GIF Border Remover

Use it to remove a border, letterbox strip, or watermark margin that's baked into every frame of a GIF you don't have the original source for.

It's also handy for undoing a border added by the GIF Border Adder tool, or for tightening up a GIF's canvas before adding a different frame style.

Features

Advantages

  • Runs entirely client-side; the uploaded animation is never sent to a server.
  • Preserves every frame's original delay and the animation's loop count exactly.
  • Crops every frame identically, so animated content stays aligned across the whole sequence.

Limitations

  • Only a uniform thickness can be cropped off all four sides in one pass; asymmetric cropping needs a different tool or a second pass.
  • If the requested thickness would leave a frame with zero or negative width/height, the tool rejects the request rather than guessing a smaller crop.

Examples

Undo a 10px border

Input

A 220x220 animated GIF (with a baked-in 10px border), thickness 10

Output

A 200x200 animated GIF with the border cropped off every frame

Cropping the same thickness that was originally added restores the original frame size exactly.

Best Practices & Notes

Best Practices

  • Double-check the exact border thickness before cropping; over-cropping will cut into the actual animated content.
  • If you're not sure of the exact thickness, try a small value first and compare the preview against the original.
  • Pair with the GIF Corner Rounder or GIF Outline Adder afterward if you want to restyle the trimmed animation.

Developer Notes

removeBorderFromGif in gif-border-remover.ts maps removeBorderFromFrame (a pure PixelBuffer crop) across every frame of a DecodedGif, preserving delayCs per frame. gif-padding-remover.ts and gif-space-remover.ts are thin wrappers around this exact function: the crop math doesn't change based on what the removed margin is called, so it's implemented once here and reused rather than duplicated three times.

GIF Border Remover Use Cases

  • Trimming a border, letterbox strip, or watermark margin baked into every frame of a source GIF
  • Undoing a border previously added with the GIF Border Adder tool
  • Tightening an animation's canvas before applying a different frame or outline style

Common Mistakes

  • Cropping more than the actual border thickness and cutting into real animated content.
  • Assuming an asymmetric border (thicker on one side) can be removed in a single pass: this tool only supports a uniform thickness.

Tips

  • If the border color is known, use the GIF Outline Remover's color-aware erase instead when the margin isn't perfectly uniform.
  • Preview the cropped result at 100% zoom to confirm no content was clipped before downloading.

References

Frequently Asked Questions