Skip to content

v13.24.0

@dr-codswallop dr-codswallop tagged this 30 Jul 21:42
* Add dominant color detection to image driver

Adds a `dominantColor()` method to the `Driver` contract and `Image` class that returns the average color of an image as a hex string, computed by downsampling image to a single pixel.

Also introduces a `'dominant'` value for the `background` parameter of `contain()` and `rotate()` transformations, which automatically fills letterbox/rotation areas with the image's dominant color.

* formatting

---------

Co-authored-by: Taylor Otwell <taylor@laravel.com>
Assets 2
Loading