PHPackages                             spatie/image - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. spatie/image

ActiveLibrary[Image &amp; Media](/categories/media)

spatie/image
============

Manipulate images with an expressive API

3.9.5(2w ago)1.4k60.7M—2.1%13920MITPHPPHP ^8.2CI passing

Since Jan 31Pushed 1w ago16 watchersCompare

[ Source](https://github.com/spatie/image)[ Packagist](https://packagist.org/packages/spatie/image)[ Docs](https://github.com/spatie/image)[ Fund](https://spatie.be/open-source/support-us)[ GitHub Sponsors](https://github.com/spatie)[ RSS](/packages/spatie-image/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (31)Versions (106)Used By (20)

 [   ![Logo for image](https://camo.githubusercontent.com/0085367a9ad6eb8ac53c51885a4c2ae72c2c7fb78493b8fc9ce9dd466c2176bb/68747470733a2f2f7370617469652e62652f7061636b616765732f6865616465722f696d6167652f68746d6c2f6c696768742e77656270)  ](https://spatie.be/open-source?utm_source=github&utm_medium=banner&utm_campaign=image)Manipulate images with an expressive API
========================================

[](#manipulate-images-with-an-expressive-api)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8da89803d676423a7562f8a023f69945463b6cbe2674f3661d0c6d3f444568a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f696d6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/image)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![GitHub Workflow Status](https://github.com/spatie/image/actions/workflows/run-tests.yml/badge.svg)](https://github.com/spatie/image/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/8015cb6b82caf47ee25a54a3aa210a820f15307dd3e8c93dc56220aa8933ed21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f696d6167652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/image)

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](https://docs.spatie.be/image).

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/11765ae669aeb9a04b86823d47a71ce64ed2f75a461b2764ac107a41e35a339b/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f696d6167652e6a70673f743d31)](https://spatie.be/github-ad-click/image)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

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](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Installation
------------

[](#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:

Usage
-----

[](#usage)

Head over to [the full documentation](https://spatie.be/docs/image).

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
npm i pixelmatch
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you've found a bug regarding security please mail  instead of using the issue tracker.

Postcardware
------------

[](#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](https://spatie.be/en/opensource/postcards).

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [All Contributors](../../contributors)

Large parts of this codebase were copied from [Intervention Image](https://image.intervention.io/v3) by [Oliver Vogel](https://github.com/olivervogel), and modified for readability and to fit our needs.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

83

—

ExcellentBetter than 100% of packages

Maintenance98

Actively maintained with recent releases

Popularity77

Solid adoption and visibility

Community51

Growing community involvement

Maturity92

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 53.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Total

99

Last Release

15d ago

Major Versions

1.10.5 → 2.0.02021-07-15

1.11.0 → 2.2.22022-02-21

2.2.7 → 3.0.02023-12-14

v1.x-dev → 3.1.02023-12-15

v2.x-dev → 3.7.52025-01-13

PHP version history (4 changes)0.0.1PHP ^7.0

1.7.7PHP ^7.2|^8.0

2.1.0PHP ^8.0

3.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7535935?v=4)[Spatie](/maintainers/spatie)[@spatie](https://github.com/spatie)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (321 commits)")[![timvandijck](https://avatars.githubusercontent.com/u/4528796?v=4)](https://github.com/timvandijck "timvandijck (65 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (36 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (30 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (20 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (18 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (10 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (9 commits)")[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (9 commits)")[![Synchro](https://avatars.githubusercontent.com/u/81561?v=4)](https://github.com/Synchro "Synchro (9 commits)")[![OzanKurt](https://avatars.githubusercontent.com/u/8682003?v=4)](https://github.com/OzanKurt "OzanKurt (7 commits)")[![nlemoine](https://avatars.githubusercontent.com/u/2526939?v=4)](https://github.com/nlemoine "nlemoine (6 commits)")[![ariaieboy](https://avatars.githubusercontent.com/u/15873972?v=4)](https://github.com/ariaieboy "ariaieboy (6 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (6 commits)")[![Peeterush](https://avatars.githubusercontent.com/u/15989311?v=4)](https://github.com/Peeterush "Peeterush (5 commits)")[![Ayoub-Mabrouk](https://avatars.githubusercontent.com/u/77799760?v=4)](https://github.com/Ayoub-Mabrouk "Ayoub-Mabrouk (5 commits)")[![GhostvOne](https://avatars.githubusercontent.com/u/798011?v=4)](https://github.com/GhostvOne "GhostvOne (4 commits)")[![schmeits](https://avatars.githubusercontent.com/u/3034840?v=4)](https://github.com/schmeits "schmeits (4 commits)")[![fabio-ivona](https://avatars.githubusercontent.com/u/8792274?v=4)](https://github.com/fabio-ivona "fabio-ivona (3 commits)")[![jimirobaer](https://avatars.githubusercontent.com/u/8984769?v=4)](https://github.com/jimirobaer "jimirobaer (3 commits)")

---

Tags

gdimageimagickphpspatieimage

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/spatie-image/health.svg)

```
[![Health](https://phpackages.com/badges/spatie-image/health.svg)](https://phpackages.com/packages/spatie-image)
```

###  Alternatives

[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k36.7M156](/packages/spatie-browsershot)[spatie/image-optimizer

Easily optimize images using PHP

2.9k79.5M160](/packages/spatie-image-optimizer)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M165](/packages/spatie-laravel-health)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
