Staaarter

GIF Slicer

Decodes an animated GIF's frames, slices out the same user-specified pixel rectangle from every one of them, and re-encodes the result as a new animated GIF. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-29
By Staaarter Team
editortransformanimationgif

Overview

Introduction

Some people search for "crop," others for "slice": this tool covers the slice-a-rectangle-out-of-a-GIF phrasing while doing the identical work gif-cropper does under a different name.

It decodes an uploaded animated GIF, slices out the same rectangle from every frame, and rebuilds a new animated GIF from the result, entirely client-side.

What Is GIF Slicer?

A client-side tool that extracts a rectangular region (given a top-left x/y coordinate plus a width and height) out of every frame of an animated GIF and re-encodes a new animation from the sliced frames.

It's implemented as a thin wrapper around gif-cropper's exact same function, rather than a separately maintained copy, so the two tools can never produce different results for the same input.

How GIF Slicer Works

The GIF is decoded into fully composited per-frame RGBA buffers, the requested rectangle is validated against the source dimensions, and that rectangle is copied out of every frame.

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

When To Use GIF Slicer

Use it whenever you need to slice out one specific rectangular piece of an animated GIF, like isolating an animated icon from a larger sprite-style GIF.

It's functionally identical to the cropper tool, so use whichever name matches how you think about the task.

Features

Advantages

  • Applies the exact same rectangle consistently to every frame, so the sliced animation stays aligned.
  • Runs entirely client-side; nothing you upload leaves your browser.
  • Shares one implementation with gif-cropper, so behavior between the two tools never drifts apart over time.

Limitations

  • The shared encoder quantizes colors to a fixed 216-color palette, so re-encoded output may differ slightly in color from the source.
  • Only a single fixed rectangle can be sliced per run; it can't track a moving subject across frames.

Examples

Slicing an icon out of an animated sprite GIF

Input

A 256x64 animated GIF sprite strip, slice at x=64, y=0, width=64, height=64

Output

A standalone 64x64 animated GIF containing just that icon's animation

The same 64x64 rectangle is sliced from every frame, isolating one icon's full animation cycle.

Best Practices & Notes

Best Practices

  • Check the uploaded GIF's exact dimensions before computing slice coordinates.
  • Make sure the region you slice contains the moving content in every frame, not just the first one.
  • Use gif-cropper interchangeably if that's the term you remember later; the two produce identical results.

Developer Notes

sliceGif in gif-slicer.ts calls cropGif from gif-cropper.ts directly and performs no independent logic, per this batch's guidance to share code rather than duplicate near-identical crop/slice tools. See gif-cropper.ts for the actual pixel-copy implementation and gif-frame-transform.ts for the shared decode/transform/re-encode pipeline both build on.

GIF Slicer Use Cases

  • Extracting one animated icon or element from a larger animated sprite GIF
  • Removing unwanted surrounding content from an animated screen recording
  • Isolating a region of interest for a smaller, more focused animated GIF

Common Mistakes

  • Assuming "slice" does something different from "crop" and trying both expecting different output; they're the same operation.
  • Choosing a rectangle that fits the first frame's content but clips a subject that moves in later frames.

Tips

  • If you're unsure whether to reach for this tool or gif-cropper, either works identically.
  • For a small, centered, optionally circular cutout instead of an arbitrary rectangle, try gif-fragment-cutter.

References

Frequently Asked Questions