Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.1 KB

README.md

File metadata and controls

37 lines (27 loc) · 1.1 KB

Intervention Image Focus Filter

Packagist Downloads CircleCI Code Climate maintainability

Example

Cropping images based on a focal point.

Requirements

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