# Optimize GIF Images

To optimize GIF images, run `npx optimo animation.gif`. Optimo applies format-specific ImageMagick-powered compression that typically reduces GIF file size by 15–40% without visible quality loss. The original file is kept if the output is not smaller.

## Command

Start here. Run optimo on an image file:

```
npx optimo animation.gif
```

Tip: add `--dry-run` to preview changes.

## When to use GIF

- simple animations
- stickers
- memes

### Trade-offs

- Huge files
- Limited colors
- Usually better as video

## Related formats

- [PNG](/content/optimize/png/index.html): Lossless image format with sharp edges and great support for transparency.
- [JPEG](/content/optimize/jpeg/index.html): The classic photo format: widely supported, good quality-to-size for photographs.
- [WebP](/content/optimize/webp/index.html): Modern image format with great compression and broad browser support.
- [AVIF](/content/optimize/avif/index.html): High-compression modern image format that can beat WebP on size at similar quality.
- [HEIC](/content/optimize/heic/index.html): A common camera output format (especially Apple devices) with efficient compression.
- [JPEG XL](/content/optimize/jxl/index.html): Next-gen image format designed for high quality and efficient compression.
- [SVG](/content/optimize/svg/index.html): Vector format: crisp at any size and excellent for icons and illustrations.

## Related conversions

- [Convert GIF to MP4](/content/convert/gif-to-mp4/index.html)
- [Convert GIF to WebM](/content/convert/gif-to-webm/index.html)
- [Convert PNG to GIF](/content/convert/png-to-gif/index.html)
- [Convert JPEG to GIF](/content/convert/jpeg-to-gif/index.html)
- [Convert WebP to GIF](/content/convert/webp-to-gif/index.html)
- [Convert AVIF to GIF](/content/convert/avif-to-gif/index.html)
- [Convert HEIC to GIF](/content/convert/heic-to-gif/index.html)
- [Convert JPEG XL to GIF](/content/convert/jxl-to-gif/index.html)

## More for GIF

- [Compress GIF](/content/compress/gif/index.html)
- [Resize GIF](/content/resize/gif/index.html)
- [What is GIF?](/content/formats/gif/index.html)

## Compare formats

If you're picking a delivery format, comparisons can help.

- [Browse comparisons](/content/compare/index.html)

## Frequently Asked Questions

**How do I optimize GIF files?**  Run "npx optimo animation.gif" in your terminal. Optimo applies format-specific ImageMagick-powered compression that reduces GIF file size while preserving quality. The original file is kept if the optimized output is not smaller.

**Is GIF optimization lossless?**  By default, optimo uses lossless optimization for GIF. For additional compression, add the --lossy flag to allow minor quality trade-offs for significantly smaller files.

**What tools does optimo use for GIF?**  Optimo uses ImageMagick, MozJPEG, and SVGO (depending on format) under the hood with format-specific settings tuned for GIF files.
