spatie / image
Manipulate images with an expressive API
Fund package maintenance!
spatie
spatie.be/open-source/support-us
Requires
- php: ^8.2
- ext-exif: *
- ext-json: *
- ext-mbstring: *
- spatie/image-optimizer: ^1.7.5
- spatie/temporary-directory: ^2.2
- symfony/process: ^6.4|^7.0
Requires (Dev)
- ext-gd: *
- ext-imagick: *
- laravel/sail: ^1.34
- pestphp/pest: ^2.28
- phpstan/phpstan: ^1.10.50
- spatie/pest-plugin-snapshots: ^2.1
- spatie/pixelmatch-php: ^1.0
- spatie/ray: ^1.40.1
- symfony/var-dumper: ^6.4|7.0
- dev-main
- v3.x-dev
- 3.7.4
- 3.7.3
- 3.7.2
- 3.7.1
- 3.7.0
- 3.6.4
- 3.6.3
- 3.6.2
- 3.6.1
- 3.6.0
- 3.5.0
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.0
- 3.0.0
- v2.x-dev
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.0
- v1.x-dev
- 1.11.0
- 1.10.6
- 1.10.5
- 1.10.4
- 1.10.3
- 1.10.2
- 1.10.1
- 1.10.0
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.7
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- 0.0.6
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.1
- dev-orientation
- dev-quality-tests
- dev-crop-issue
This package is auto-updated.
Last update: 2024-11-18 15:07:30 UTC
README
Image manipulation doesn't have to be hard. Here are a few examples on how this package makes it very easy to manipulate images.
use Spatie\Image\Image; // modifying the image so it fits in a 100x100 rectangle without altering aspect ratio Image::load($pathToImage) ->width(100) ->height(100) ->save($pathToNewImage); // overwriting the original image with a greyscale version Image::load($pathToImage) ->greyscale() ->save(); // make image darker and save it in low quality Image::load($pathToImage) ->brightness(-30) ->quality(25) ->save(); // rotate the image and sharpen it Image::load($pathToImage) ->orientation(90) ->sharpen(15) ->save();
You'll find more examples in the full documentation.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
composer require spatie/image
Please note that since version 1.5.3 this package requires exif extension to be enabled: http://php.net/manual/en/exif.installation.php
Usage
Head over to the full documentation.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Testing
npm i pixelmatch
composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you've found a bug regarding security please mail security@spatie.be instead of using the issue tracker.
Postcardware
You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.
We publish all received postcards on our company website.
Credits
Large parts of this codebase were copied from Intervention Image by Oliver Vogel, and modified for readability and to fit our needs.
License
The MIT License (MIT). Please see License File for more information.