edwin-luijten / intervention-image-focus
Intervention Image filter to crop images with a focal point
1.0.0
2021-12-19 11:14 UTC
Requires
- php: ^7.4 | ^8.1
- intervention/image: ^2.7.1
Requires (Dev)
- phpstan/phpstan: ^1.2
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-11-19 18:51:48 UTC
README
Cropping images based on a focal point.
Requirements
- PHP ^7.4 or ^8.1
- Intervention Image
Installation
composer require edwin-luijten/intervention-image-focus
Usage
use Intervention\Image\ImageManager; use EdwinLuijten\InterventionImageFocus\FocusFilter; $manager = new ImageManager(); $image = $manager->make('foo.png'); // x-y percentage $image->filter(new FocusFilter(500, 500, '75-50'))); $image->encode('png'); $image->save('test.png');
Image attribution:
Title: Sunset city skyline
Author: Kevin Young @ Unsplash
Source: https://unsplash.com/photos/-icmOdYWXuQ