Skip to content

FormatQuality

Sets the quality for individual output formats.

imgproxy: format_quality (alias fq) · Availability: all editions

use SomehowDigital\ImgProxy\Url;
use SomehowDigital\ImgProxy\Option\FormatQuality;
$url = Url::create()
->source('https://example.com/image.jpg')
->options(new FormatQuality(['jpeg' => 80, 'webp' => 70]));
$url->build();
// _/fq:jpeg:80:webp:70/plain/https%3A%2F%2Fexample.com%2Fimage.jpg

The option appears in the URL as fq:jpeg:80:webp:70.

Parameter Type Default Description
$qualities array required A map of format to quality. It must not be empty.
  • An empty array throws an InvalidArgumentException.

imgproxy reference