URL: /rules/images/modern-format

---
title: "Modern Image Formats"
description: "Checks for modern image formats like WebP or AVIF"
---

Checks for modern image formats like WebP or AVIF

| | |
|---|---|
| **Rule ID** | `images/modern-format` |
| **Category** | [Images](/rules/images) |
| **Scope** | Per-page |
| **Severity** | info |
| **Weight** | 3/10 |

## Solution

Modern formats (WebP, AVIF) offer 25-50% better compression than JPEG/PNG with similar quality. Use `<picture>` with WebP/AVIF sources and fallbacks. Most browsers support WebP (97%+). AVIF offers even better compression but lower support (~92%). Convert images with tools like cwebp, squoosh, or sharp.

## Enable / Disable

### Disable this rule

```toml squirrel.toml
[rules]
disable = ["images/modern-format"]
```

### Disable all Images rules

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

### Enable only this rule

```toml squirrel.toml
[rules]
enable = ["images/modern-format"]
disable = ["*"]
```
