PHPackages                             intervention/image-laravel - 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. intervention/image-laravel

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

intervention/image-laravel
==========================

Laravel Integration of Intervention Image

1.5.8(1mo ago)1536.5M—2.4%15[1 issues](https://github.com/Intervention/image-laravel/issues)20MITPHPPHP ^8.1CI passing

Since Jan 17Pushed 2w ago2 watchersCompare

[ Source](https://github.com/Intervention/image-laravel)[ Packagist](https://packagist.org/packages/intervention/image-laravel)[ Docs](https://image.intervention.io/)[ Fund](https://paypal.me/interventionio)[ GitHub Sponsors](https://github.com/Intervention)[ RSS](/packages/intervention-image-laravel/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (22)Used By (20)

Intervention Image Laravel
==========================

[](#intervention-image-laravel)

Laravel Integration for Intervention Image
------------------------------------------

[](#laravel-integration-for-intervention-image)

[![Latest Version](https://camo.githubusercontent.com/2336d54a532061e5bf8256b32b0e656354e7280ef5dd8abf7222bf79b8a8893a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e74657276656e74696f6e2f696d6167652d6c61726176656c2e737667)](https://packagist.org/packages/intervention/image-laravel)[![Tests](https://github.com/Intervention/image-laravel/actions/workflows/build.yml/badge.svg)](https://github.com/Intervention/image-laravel/actions/workflows/build.yml)[![Monthly Downloads](https://camo.githubusercontent.com/bf9b44e7c327298c987216c161391e67a86c708fa96f2900457063a5f0f47ae0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f696e74657276656e74696f6e2f696d6167652d6c61726176656c2e737667)](https://packagist.org/packages/intervention/image-laravel/stats)[![Support me on Ko-fi](https://raw.githubusercontent.com/Intervention/image-laravel/main/.github/images/support.svg)](https://ko-fi.com/interventionphp)

This package provides an integration to setup [Intervention Image](https://image.intervention.io) easily to your Laravel application. Included are a Laravel service provider, facade and a publishable configuration file.

Requirements
------------

[](#requirements)

- Laravel &gt;= 8

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

[](#installation)

In your existing Laravel application you can install this package using [Composer](https://getcomposer.org).

```
composer require intervention/image-laravel
```

Features
--------

[](#features)

Although Intervention Image can be used with Laravel without this extension, this integration package includes the following features that make image interaction with the framework much easier.

### Application-wide configuration

[](#application-wide-configuration)

The extension comes with a global configuration file that is recognized by Laravel. It is therefore possible to store the settings for Intervention Image once centrally and not have to define them individually each time you call the image manager.

The configuration file can be copied to the application with the following command.

```
php artisan vendor:publish --provider="Intervention\Image\Laravel\ServiceProvider"
```

This command will publish the configuration file `config/image.php`. Here you can set the desired driver and its configuration options for Intervention Image. By default the library is configured to use GD library for image processing.

The configuration files looks like this.

```
return [

    /*
    |--------------------------------------------------------------------------
    | Image Driver
    |--------------------------------------------------------------------------
    |
    | Intervention Image supports “GD Library” and “Imagick” to process images
    | internally. Depending on your PHP setup, you can choose one of them.
    |
    | Included options:
    |   - \Intervention\Image\Drivers\Gd\Driver::class
    |   - \Intervention\Image\Drivers\Imagick\Driver::class
    |   - \Intervention\Image\Drivers\Vips\Driver::class
    */

    'driver' => env('IMAGE_DRIVER', \Intervention\Image\Drivers\Gd\Driver::class),

    /*
    |--------------------------------------------------------------------------
    | Configuration Options
    |--------------------------------------------------------------------------
    |
    | These options control the behavior of Intervention Image.
    |
    | - "autoOrientation" controls whether an imported image should be
    |    automatically rotated according to any existing Exif data.
    |
    | - "decodeAnimation" decides whether a possibly animated image is
    |    decoded as such or whether the animation is discarded.
    |
    | - "backgroundColor" Defines the default background & blending color.
    |
    | - "strip" controls if meta data like exif tags should be removed when
    |    encoding images.
    */

    'options' => [
        'autoOrientation' => true,
        'decodeAnimation' => true,
        'backgroundColor' => 'ffffff',
        'strip' => false,
    ]
];
```

You can read more about the different options for [driver selection](https://image.intervention.io/v4/basics/configuration-drivers#driver-selection), setting options for [auto orientation](https://image.intervention.io/v4/modifying-images/effects#image-orientation-according-to-exif-data), [decoding animations](https://image.intervention.io/v4/modifying-images/animations) and [background color](https://image.intervention.io/v4/basics/colors#transparency).

### Static Facade Interface

[](#static-facade-interface)

This package also integrates access to Intervention Image's central entry point, the `ImageManager::class`, via a static [facade](https://laravel.com/docs/11.x/facades). The call provides access to the centrally configured [image manager](https://image.intervention.io/v4/basics/instantiation) via singleton pattern.

The following code example shows how to read an image from an upload request the image facade in a Laravel route and save it on disk with a random file name.

```
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Intervention\Image\Laravel\Facades\Image;

Route::get('/', function (Request $request) {
    $upload = $request->file('image');
    $image = Image::decode($upload)
        ->resize(300, 200);

    Storage::put(
        Str::random() . '.' . $upload->getClientOriginalExtension(),
        $image->encodeUsingFileExtension($upload->getClientOriginalExtension(), quality: 70)
    );
});
```

### Image Response Macro

[](#image-response-macro)

Furthermore, the package includes a response macro that can be used to elegantly encode an image resource and convert it to an HTTP response in a single step.

The following code example shows how to read an image from disk apply modifications and use the image response macro to encode it and send the image back to the user in one call. Only the first parameter is required.

```
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Storage;
use Intervention\Image\Format;
use Intervention\Image\Laravel\Facades\Image;

Route::get('/', function () {
    $image = Image::decode(Storage::get('example.jpg'))
        ->scale(300, 200);

    return response()->image($image, Format::WEBP, quality: 65);
});
```

You can read more about intervention image in general in the [official documentation of Intervention Image](https://image.intervention.io).

Authors
-------

[](#authors)

This library is developed and maintained by [Oliver Vogel](https://intervention.io)

Thanks to the community of [contributors](https://github.com/Intervention/image-laravel/graphs/contributors) who have helped to improve this project.

License
-------

[](#license)

Intervention Image Laravel is licensed under the [MIT License](LICENSE).

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance93

Actively maintained with recent releases

Popularity62

Solid adoption and visibility

Community34

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 86.5% 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 ~46 days

Recently: every ~96 days

Total

18

Last Release

59d ago

Major Versions

0.0.3 → 1.0.02024-01-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d172b42b2c5b53e71e56589fed3fb3467234a1c266d31b697b1d7b451f4cfe8?d=identicon)[olivervogel](/maintainers/olivervogel)

---

Top Contributors

[![olivervogel](https://avatars.githubusercontent.com/u/884642?v=4)](https://github.com/olivervogel "olivervogel (77 commits)")[![diamondobama](https://avatars.githubusercontent.com/u/7268931?v=4)](https://github.com/diamondobama "diamondobama (6 commits)")[![calebdw](https://avatars.githubusercontent.com/u/4176520?v=4)](https://github.com/calebdw "calebdw (4 commits)")[![apih](https://avatars.githubusercontent.com/u/798269?v=4)](https://github.com/apih "apih (1 commits)")[![Erulezz](https://avatars.githubusercontent.com/u/6772197?v=4)](https://github.com/Erulezz "Erulezz (1 commits)")

---

Tags

gdimageimagickinterventionlaravellaravelthumbnailimagegdimagickresizewatermark

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[intervention/image

PHP Image Processing

14.3k194.3M2.2k](/packages/intervention-image)[folklore/image

Image manipulation library for Laravel 5 based on Imagine and inspired by Croppa for easy url based manipulation

270248.2k5](/packages/folklore-image)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[intervention/image-symfony

Symfony Integration of Intervention Image

1066.8k](/packages/intervention-image-symfony)

PHPackages © 2026

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