> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-support-migration.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quality

> Control image compression for optimal balance between file size and visual quality

Optimize image file size with quality controls that balance visual fidelity with bandwidth savings. Adjust compression levels to deliver fast-loading images without sacrificing appearance.

## Parameter

<ParamField query="quality" type="integer">
  Control the compression level of the output image.

  **Range:** `0` to `100` (higher values = better quality, larger file size)

  **Default:** `85` (or configured Smart Image Optimization value)
</ParamField>

## How it works

The quality parameter controls the compression ratio applied to the image. Higher values preserve more detail but result in larger file sizes. Lower values reduce file size but may introduce compression artifacts.

Quality affects JPEG, WebP, and AVIF formats. For formats that don't support lossy compression (like PNG), the quality parameter has no effect.

## Usage

### Quality control

Adjust the compression level to balance visual quality with file size. Higher quality values preserve more detail but increase bandwidth usage.

```bash High quality theme={null}
https://yourzone.b-cdn.net/image.jpg?quality=80
```

| quality=80                                                                               | quality=50                                                                                | quality=10                                                                             |
| ---------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| ![High quality (117KB)](https://bunny-optimizer-demo.b-cdn.net/bunnies_1.jpg?quality=80) | ![Medium quality (81KB)](https://bunny-optimizer-demo.b-cdn.net/bunnies_1.jpg?quality=50) | ![Low quality (35KB)](https://bunny-optimizer-demo.b-cdn.net/bunnies_1.jpg?quality=10) |

As shown above, reducing quality from 80 to 50 cuts file size by nearly 30% with minimal visible impact. Extreme compression (`quality=10`) significantly reduces file size but introduces noticeable artifacts.

```bash Recommended for web use theme={null}
https://yourzone.b-cdn.net/image.jpg?quality=75
```

A quality setting between 70-85 typically provides the best balance for web images, maintaining good visual quality while achieving substantial file size reduction.

### Default quality behavior

If you don't specify a quality parameter, Bunny Optimizer uses a default value based on your configuration.

#### Smart Image Optimization

Configure quality defaults in your Pull Zone settings at **Optimizer → Settings**. You can set different quality levels for desktop, mobile, and other device types.

With Smart Image Optimization enabled, desktop requests might use `quality=80` while mobile devices use `quality=70` to reduce bandwidth on slower connections.

#### Fallback default

When Smart Image Optimization is not configured and no quality parameter is provided, images default to `quality=85`.

<Note>
  **Priority order:** Quality specified in query parameters takes highest
  priority, followed by Smart Image Optimization settings, then the fallback
  default of 85.
</Note>

## Combining with other transformations

Quality works seamlessly with all other Bunny Optimizer transformations:

```bash Resize with quality control theme={null}
https://yourzone.b-cdn.net/image.jpg?width=800&quality=75
```

```bash Crop, resize, and optimize theme={null}
https://yourzone.b-cdn.net/image.jpg?crop=600,400&width=300&quality=80
```

```bash Complete optimization pipeline theme={null}
https://yourzone.b-cdn.net/image.jpg?width=1200&quality=75&format=webp&sharpen=true
```

Combining transformations allows you to resize, crop, apply filters, and optimize compression in a single request, reducing processing overhead and simplifying your image workflow.

## Best practices

**For photography and detailed images:** Use quality values between 75-85 to preserve detail while achieving good compression.

**For thumbnails and previews:** Quality values between 60-75 are often sufficient, as small images hide compression artifacts better.

**For images with text or sharp edges:** Consider using PNG format or higher quality values (85+) to avoid artifacts around text.

**For maximum bandwidth savings:** Combine quality settings with WebP or AVIF [format conversion](/optimizer/dynamic-images/formats), but always verify visual quality meets your standards.

**Test on real devices:** Quality perception varies across devices and screen resolutions. Test your quality settings on target devices to ensure acceptable visual results.

**Consider content type:** Photographs can tolerate lower quality settings (60-75) better than graphics, logos, or screenshots which benefit from higher settings (80-90).
