← All articles 14 min read

How to Crop a GIF (5 Methods, Animated Frames Intact)

Cropping a static image is trivial. Cropping an animated GIF is not. Every frame in the animation needs the same crop applied simultaneously, and the result must loop seamlessly. Get one frame wrong and the animation stutters, shifts, or breaks entirely.

The most common reasons you need to crop a GIF: removing black bars from a screen recording, trimming a watermark from a reaction GIF, cutting a 500x500 canvas down to the specific region where the action happens, or fitting an animation into a platform's required dimensions. Every case requires the crop to be applied across all frames, preserving timing and disposal methods.

Pixotter's GIF cropper handles this in your browser. Drop the GIF, drag the crop region, download the result. Every frame is cropped identically using WebAssembly — your file never leaves your device, there is no upload, and there is no file size limit.


Crop a GIF right now -- no install, no upload:

Open Pixotter GIF Cropper


The rest of this guide covers five methods for cropping GIFs, from instant browser tools to scriptable CLI workflows. Pick the one that fits your situation.


Five Ways to Crop a GIF

Method Type Batch Support Animated GIF Platform Cost
Pixotter Browser (WASM) Yes Yes Any OS with a browser Free
Gifsicle 1.95 CLI Yes Yes Windows, macOS, Linux Free (GPLv2)
FFmpeg 7.0 CLI Yes Yes Windows, macOS, Linux Free (LGPL/GPL)
GIMP 2.10.36 Desktop GUI No Yes (frame-by-frame) Windows, macOS, Linux Free (GPLv3)
ezgif.com Browser (server-side) No Yes Any OS with a browser Free (with ads)

Method 1: Pixotter (Browser, No Install, No Upload)

The fastest path. Pixotter runs entirely client-side using libvips compiled to WebAssembly, so the crop happens on your device. No server round-trip, no file size cap, no account required.

  1. Open pixotter.com/gif-crop.
  2. Drop your animated GIF onto the page.
  3. Drag the crop handles to define the region you want to keep. The preview updates in real time across all frames.
  4. Click Crop and download the cropped GIF.

Pixotter applies the crop uniformly to every frame and preserves the original frame timing, disposal methods, and loop count. The result plays back identically to the original, just with a smaller canvas.

Batch cropping: Drop multiple GIFs at once. Each file gets the same crop region applied, which is ideal for cropping a series of screen recordings or reaction GIFs captured at the same resolution.

Best for: Quick one-off crops, batch jobs, privacy-sensitive files you do not want to upload, and situations where you cannot install software (work computers, Chromebooks, tablets).

Method 2: Gifsicle 1.95 (Command Line)

Gifsicle (GPLv2) is the standard CLI tool for manipulating GIF files. It operates directly on the GIF structure without decoding and re-encoding frames, which means crops are fast and lossless.

# Install Gifsicle 1.95
# macOS: brew install gifsicle
# Ubuntu/Debian: sudo apt install gifsicle
# Windows: download from lcdf.org/gifsicle

# Crop to a 300x200 region starting at pixel (50, 30)
gifsicle --crop 50,30+300x200 input.gif -o cropped.gif

# Crop 20 pixels from each edge (left, top, right, bottom inferred from original size)
# For a 640x480 GIF, this crops to the region starting at (20,20) with size 600x440
gifsicle --crop 20,20+600x440 input.gif -o cropped.gif

# Crop and optimize in one pass
gifsicle --crop 50,30+300x200 -O3 input.gif -o cropped.gif

The --crop syntax is LEFT,TOP+WIDTHxHEIGHT. Coordinates are in pixels, measured from the top-left corner of the original canvas.

Batch cropping:

# Apply the same crop to every GIF in the current directory
for f in *.gif; do
    gifsicle --crop 50,30+300x200 -O3 "$f" -o "cropped_$f"
done

Combine with other operations:

# Crop, then resize the cropped result to 200px wide, then optimize
gifsicle --crop 50,30+300x200 --resize-width 200 -O3 input.gif -o final.gif

Gifsicle processes the crop before the resize, so the aspect ratio of the cropped region is preserved.

Best for: Developers who want scriptable, repeatable GIF processing. CI/CD pipelines, build scripts, automated content workflows.

Method 3: FFmpeg 7.0 (Command Line)

FFmpeg (LGPL/GPL, depending on build configuration) can crop animated GIFs using its video filter chain. Unlike Gifsicle, FFmpeg decodes every frame to raw pixels, applies the crop filter, and re-encodes the output. This means you can combine cropping with palette optimization for better results on photographic GIFs.

# Basic crop: 300x200 region starting at pixel (50, 30)
ffmpeg -i input.gif -vf "crop=300:200:50:30" -gifflags +transdiff cropped.gif

# Crop with optimized palette (better color quality)
ffmpeg -i input.gif -vf "crop=300:200:50:30,split[s0][s1];[s0]palettegen=max_colors=256[p];[s1][p]paletteuse=dither=bayer:bayer_scale=3" cropped.gif

# Crop and reduce frame rate simultaneously
ffmpeg -i input.gif -vf "crop=300:200:50:30,fps=15" -gifflags +transdiff cropped.gif

The crop filter syntax is crop=WIDTH:HEIGHT:X:Y. The -gifflags +transdiff flag enables transparency optimization, where only changed pixels between frames are stored. This reduces file size significantly for GIFs with static backgrounds.

Batch cropping:

# Crop every GIF in the current directory
for f in *.gif; do
    ffmpeg -i "$f" -vf "crop=300:200:50:30" -gifflags +transdiff "cropped_${f}" -y
done

When FFmpeg beats Gifsicle for cropping: When you also need to re-optimize the color palette, change the frame rate, or apply additional filters (brightness, contrast, sharpening) in the same pass. FFmpeg's filter graph handles all of this in a single decode-process-encode cycle.

Best for: Power users who need to combine cropping with other transformations, or who are already using FFmpeg in their media pipeline.

Method 4: GIMP 2.10.36 (Desktop GUI)

GIMP (GPLv3) opens animated GIFs as a stack of layers, one per frame. Cropping in GIMP gives you visual, pixel-precise control.

  1. Open the GIF in GIMP 2.10.36. Each frame appears as a separate layer in the Layers panel.
  2. Use the Rectangle Select tool (R key) to draw the crop region on the canvas. Position it precisely using the Tool Options panel (enter exact X, Y, Width, Height values).
  3. Go to Image > Crop to Selection. GIMP applies the crop to the canvas, and all layers (frames) are cropped uniformly.
  4. Verify the animation: Filters > Animation > Playback to preview.
  5. Export: File > Export As > name the file with a .gif extension > check As animation > set the frame delay and loop settings > Export.

Handling frames that extend beyond the canvas: Some GIFs use frame offsets where individual frames are positioned at different coordinates within the canvas. After cropping, go to Image > Flatten Image only if you want to merge — otherwise, use Image > Crop to Selection which respects layer offsets. Preview the animation before exporting to confirm nothing shifted.

Best for: Situations where you need to visually inspect and fine-tune the crop region, or when you want to make frame-level edits (deleting specific frames, editing content within frames) alongside the crop.

Method 5: ezgif.com (Browser, Server-Side)

ezgif.com/crop is a web-based GIF cropper. Upload your GIF, use the visual crop tool to select a region, and download the result. Maximum upload size is 50 MB.

  1. Go to ezgif.com/crop.
  2. Upload the GIF or paste a URL.
  3. Drag the crop handles on the preview.
  4. Click Crop image and download.

The processing happens on ezgif's servers. Your file is uploaded, processed remotely, and the result is sent back.

Limitations: 50 MB file size limit, server-side processing introduces latency, no batch support, and ads on every page. For privacy-sensitive content (unreleased product screenshots, internal communications), uploading to a third-party server may not be acceptable.

Best for: One-off crops when you cannot install anything and do not care about the file leaving your device.


When to Crop a GIF

Cropping is the right tool when you need to reduce the canvas size by removing content from the edges. Here are the most common scenarios.

Remove Unwanted Borders

Screen recordings often capture window chrome, taskbars, or extra desktop space around the area of interest. A screen recording of a UI interaction might be 1920x1080 when the relevant region is only 600x400. Crop to that region and the file size drops proportionally.

Trim Watermarks

GIFs downloaded from watermarked sources often have a branded bar along the bottom or a corner logo. Cropping removes that strip. If the watermark overlaps the main content, cropping alone will not help — you would need to re-create the GIF from the original source.

Focus on the Action

A reaction GIF might show an entire scene when only the facial expression matters. Cropping to a tight frame around the subject makes the GIF more impactful and smaller in file size. This is especially effective for GIFs used in chat applications where display sizes are small.

Meet Platform Dimension Requirements

Some platforms enforce specific aspect ratios or maximum dimensions:

Create Seamless Loops

Sometimes a GIF has content at the edges that makes the loop point obvious — a person walking into frame, a scrolling element that resets. Cropping to a region where the first and last frames match creates a cleaner loop.


Cropping vs. Resizing: Know the Difference

These two operations are often confused, but they do fundamentally different things to your GIF.

Cropping removes pixels from the edges of the canvas. The remaining pixels stay at their original resolution. A 640x480 GIF cropped to a 400x300 region still has the same pixel density — you just removed 240 columns and 180 rows of content.

Resizing (also called scaling) keeps all the content but changes the pixel dimensions. A 640x480 GIF resized to 320x240 has the same content, but every pixel has been interpolated to fit the smaller grid. Detail is lost uniformly.

Cropping Resizing
Dimensions changed Yes — canvas shrinks Yes — canvas shrinks or grows
Aspect ratio Changes freely (crop any rectangle) Usually preserved (scale proportionally)
Content removed Yes — edges are cut No — all content is kept, just scaled
Pixel quality Unchanged (no resampling) Reduced (interpolation blurs detail)
File size impact Proportional to area removed Proportional to total pixel reduction
Best use case Remove unwanted edges, focus on a region Fit into a specific display size

When to crop: You want to remove content. The subject is in one part of the frame, and the rest is irrelevant.

When to resize: You want to keep everything but make it smaller. The entire frame matters, just at a lower resolution.

When to do both: Crop first to isolate the region of interest, then resize the cropped result to the target dimensions. This order matters — cropping first means the resize operation processes fewer pixels, resulting in a sharper final image and faster processing.

Need to resize instead? Pixotter's GIF resizer handles animated GIFs with the same client-side approach — drop, resize, download.


Technical Details: What Happens When You Crop an Animated GIF

Understanding the GIF structure helps explain why cropping animated GIFs is more complex than cropping a JPEG.

Frame Disposal Methods

Each frame in an animated GIF has a disposal method that tells the decoder what to do with the frame after displaying it:

When you crop a GIF, the crop must account for these disposal methods. A naive crop that just trims pixel data without adjusting frame offsets and disposal regions will produce rendering artifacts — ghosting, flickering, or frames that appear shifted.

Tools like Gifsicle and Pixotter handle this correctly by processing the crop at the structural level. FFmpeg handles it by fully decoding all frames, applying the crop to the decoded output, and re-encoding. Both approaches produce correct results, but Gifsicle's approach preserves the original encoding quality while FFmpeg re-encodes.

Frame Offsets

GIF frames do not have to cover the entire canvas. Each frame can be a sub-rectangle positioned at an offset within the canvas. When a crop region intersects with a frame that has an offset, the tool must recalculate the frame's position relative to the new canvas origin. Frames that fall entirely outside the crop region are not removed — they become zero-size frames that maintain timing. Most tools handle this correctly, but manual implementations (writing your own GIF crop in Python, for example) frequently get this wrong.


Optimizing After Cropping

Cropping a GIF reduces file size in proportion to the area removed (fewer pixels per frame = less data). But you can often compress the cropped result further.

After cropping, consider running the result through Pixotter's GIF compressor or Gifsicle's -O3 --lossy=80 mode. Cropping sometimes leaves behind suboptimal color tables — the palette still contains colors from the regions you removed. Re-optimizing the palette and LZW compression reclaims that space.

A typical workflow:

  1. Crop to the region of interest (Pixotter GIF Cropper)
  2. Compress to optimize the cropped result (Pixotter GIF Compressor)
  3. Convert to MP4 if the platform supports video and you want maximum size savings (convert GIF to MP4)

This pipeline can reduce a 10 MB GIF to under 500 KB while keeping the content intact.


Frequently Asked Questions

Can I crop an animated GIF without losing the animation?

Yes. All five methods described above preserve animation. The crop is applied to every frame uniformly. Frame timing, loop count, and disposal methods are maintained. The only thing that changes is the canvas size — the animation plays back exactly as before, just showing a smaller region.

What is the best free GIF cropping tool?

For most people, Pixotter's GIF cropper is the fastest option — it runs in your browser, requires no installation, and keeps your files private by processing everything locally. For developers who need scriptable batch processing, Gifsicle 1.95 is the standard. For complex workflows that combine cropping with palette optimization, FFmpeg 7.0 gives you the most control.

Does cropping a GIF reduce file size?

Yes, directly. GIF file size is roughly proportional to the number of pixels per frame multiplied by the number of frames. Cropping reduces pixels per frame, so file size drops accordingly. Cropping a 640x480 GIF to 320x240 removes 75% of the pixel data and typically results in a 60-75% file size reduction (not exactly 75% because of LZW compression characteristics and metadata overhead).

How do I crop a GIF to a specific pixel size?

Use exact coordinates. In Gifsicle: gifsicle --crop X,Y+WIDTHxHEIGHT input.gif -o output.gif. In FFmpeg: ffmpeg -i input.gif -vf "crop=WIDTH:HEIGHT:X:Y" output.gif. In Pixotter, enter the exact dimensions in the crop tool's input fields instead of dragging the handles. In GIMP, type the coordinates into the Rectangle Select tool options before applying Image > Crop to Selection.

Can I crop a GIF to a circle or custom shape?

GIF does not support transparency per-pixel in the way PNG does. GIF has a single transparent color index, so you can set pixels outside the circle to the transparent color — but the canvas remains rectangular, and the edges will be jagged (no anti-aliasing on transparency boundaries). For circular or custom-shape crops with smooth edges, convert the GIF to an APNG or WebP animation that supports alpha transparency, apply the mask, and use that format instead.

Should I crop first and then compress, or compress first?

Crop first, then compress. Cropping removes pixel data, which means the compressor has less data to process. Colors that existed only in the cropped-away regions can be removed from the palette, and inter-frame deltas become smaller. Compressing first and then cropping wastes effort — the compressor optimizes data you are about to discard.


Summary

Cropping animated GIFs requires a tool that processes every frame correctly. For quick, private, browser-based cropping, use Pixotter's GIF cropper. For scriptable CLI workflows, use Gifsicle 1.95 (GPLv2) or FFmpeg 7.0 (LGPL/GPL). For visual, frame-level control, use GIMP 2.10.36 (GPLv3).

After cropping, optimize the result with Pixotter's GIF compressor to reclaim palette space and tighten LZW compression. If you need to resize rather than crop, Pixotter's GIF resizer handles that with the same client-side approach. And if the GIF is destined for a platform that supports video, converting to MP4 will cut the file size by another 80-90%.

Ready to crop your GIF?

Open Pixotter GIF Cropper


Also try: Compress Images