Skip to content

GravitySmart

Gravity on the most interesting part of the image, as detected by imgproxy.

imgproxy: gravity (alias g) · Availability: all editions

use SomehowDigital\ImgProxy\Url;
use SomehowDigital\ImgProxy\Option\GravitySmart;
$url = Url::create()
->source('https://example.com/image.jpg')
->options(new GravitySmart());
$url->build();
// _/g:sm/plain/https%3A%2F%2Fexample.com%2Fimage.jpg

The option appears in the URL as g:sm.

This option takes no parameters.

  • Not allowed for Extend and ExtendAspectRatio.

imgproxy reference