Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/edwin-luijten/intervention-image-focus
- Owner: Edwin-Luijten
- License: mit
- Created: 2021-12-17T21:29:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-19T12:31:57.000Z (about 3 years ago)
- Last Synced: 2024-11-13T13:35:30.538Z (about 2 months ago)
- Language: PHP
- Size: 6.29 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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