URL: /rules/perf/animated-content

---
title: "Animated Content"
description: "Checks for large GIFs that could be converted to video"
---

Checks for large GIFs that could be converted to video

| | |
|---|---|
| **Rule ID** | `perf/animated-content` |
| **Category** | [Performance](/rules/perf) |
| **Scope** | Per-page |
| **Severity** | warning |
| **Weight** | 4/10 |

## Solution

Convert large animated GIFs to video formats (MP4, WebM) for 50-90% smaller files. Use `<video autoplay loop muted playsinline>` for GIF-like behavior. Tools: ffmpeg, gif2webm, or Cloudinary can automate conversion. Modern video codecs are far more efficient than GIF for animation.

## Options

This rule supports the following configuration options:

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `gif_size_threshold_kb` | unknown | `undefined` | GIF size threshold in KB above which to suggest video conversion |

### Configuration Example

```toml squirrel.toml
[rules."perf/animated-content"]
gif_size_threshold_kb = undefined
```

## Enable / Disable

### Disable this rule

```toml squirrel.toml
[rules]
disable = ["perf/animated-content"]
```

### Disable all Performance rules

```toml squirrel.toml
[rules]
disable = ["perf/*"]
```

### Enable only this rule

```toml squirrel.toml
[rules]
enable = ["perf/animated-content"]
disable = ["*"]
```
