Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/edwin-luijten/intervention-image-focus

Cropping images based on a focal point.
https://github.com/edwin-luijten/intervention-image-focus

Last synced: about 2 months ago
JSON representation

Cropping images based on a focal point.

Awesome Lists containing this project

README

        

# Intervention Image Focus Filter

![Packagist Downloads](https://img.shields.io/packagist/dt/edwin-luijten/intervention-image-focus?style=flat-square)
![CircleCI](https://img.shields.io/circleci/build/github/Edwin-Luijten/intervention-image-focus/main?style=flat-square)
![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/Edwin-Luijten/intervention-image-focus?style=flat-square)

![Example](example.png)

Cropping images based on a focal point.

## Requirements
- PHP ^7.4 or ^8.1
- [Intervention Image](http://image.intervention.io/)

## Installation
```composer require edwin-luijten/intervention-image-focus```

## Usage
```php
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](https://unsplash.com/photos/-icmOdYWXuQ)
Source: https://unsplash.com/photos/-icmOdYWXuQ