Skip to main content
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

quality
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)

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.
High quality
https://yourzone.b-cdn.net/image.jpg?quality=80
quality=80quality=50quality=10
High quality (117KB)Medium quality (81KB)Low quality (35KB)
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.
Recommended for web use
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.
Priority order: Quality specified in query parameters takes highest priority, followed by Smart Image Optimization settings, then the fallback default of 85.

Combining with other transformations

Quality works seamlessly with all other Bunny Optimizer transformations:
Resize with quality control
https://yourzone.b-cdn.net/image.jpg?width=800&quality=75
Crop, resize, and optimize
https://yourzone.b-cdn.net/image.jpg?crop=600,400&width=300&quality=80
Complete optimization pipeline
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, 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).