Introduction | image | Spatie

 SPATIE

  Image
========

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Image](https://spatie.be/docs/image/v2)  Introduction

 Version   v3   v2   v1

 Other versions for crawler [v3](https://spatie.be/docs/image/v3) [v2](https://spatie.be/docs/image/v2) [v1](https://spatie.be/docs/image/v1)

- [ Introduction ](https://spatie.be/docs/image/v2/introduction)
- [ Postcardware ](https://spatie.be/docs/image/v2/postcardware)
- [ Installation and setup ](https://spatie.be/docs/image/v2/installation-and-setup)
- [ Questions &amp; issues ](https://spatie.be/docs/image/v2/questions-and-issues)
- [ Changelog ](https://spatie.be/docs/image/v2/changelog)
- [ About us ](https://spatie.be/docs/image/v2/about-us)

Usage
-----

- [ Basic usage ](https://spatie.be/docs/image/v2/usage/basic-usage)
- [ Saving images ](https://spatie.be/docs/image/v2/usage/saving-images)
- [ Retrieving properties ](https://spatie.be/docs/image/v2/usage/retrieving-properties)
- [ Preparing manipulations ](https://spatie.be/docs/image/v2/usage/preparing-manipulations)
- [ Advanced manipulations ](https://spatie.be/docs/image/v2/usage/advanced-manipulations)

Image manipulations
-------------------

- [ Overview ](https://spatie.be/docs/image/v2/image-manipulations/overview)
- [ Resizing images ](https://spatie.be/docs/image/v2/image-manipulations/resizing-images)
- [ Optimizing images ](https://spatie.be/docs/image/v2/image-manipulations/optimizing-images)
- [ Adjustments ](https://spatie.be/docs/image/v2/image-manipulations/adjustments)
- [ Image canvas ](https://spatie.be/docs/image/v2/image-manipulations/image-canvas)
- [ Effects ](https://spatie.be/docs/image/v2/image-manipulations/effects)
- [ Watermarks ](https://spatie.be/docs/image/v2/image-manipulations/watermarks)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/image                                                                                                                                                                                                                                    `

 Image
=======

 Manipulate images with an expressive API

 [    Repository ](https://github.com/spatie/image)

    53,012,354

    1,357

Introduction
------------

###  On this page

1. [ Quick examples ](#content-quick-examples)

Image manipulation doesn't have to be hard. This PHP package makes it super easy to apply common manipulations to images like resizing, cropping and adding effects.

For all available manipulations, please see the [overview](/image/v1/image-manipulations/overview).

Under the hood this package uses [Glide](http://glide.thephpleague.com) by [Jonathan Reinink](https://twitter.com/reinink).

Quick examples
--------------------------------------------------------------------------------------------------

For all the examples in this documentation we'll use this beautiful photo of New York:

![Example Image](images/example.jpg)

### Sepia and blur

By chaining multiple manipulation methods together we can quickly add a nice effect to our image:

```
Image::load('example.jpg')
    ->sepia()
    ->blur(50)
    ->save();
```

![Sepia + blur manipulation](images/example-sepia-blur.jpg)

### Cropping the Starbucks storefront

The `manualCrop` method allows you to crop very specific parts of an image:

```
Image::load('example.jpg')
    ->manualCrop(600, 400, 20, 620)
    ->save();
```

![Crop Starbucks](images/example-manual-crop.jpg)

### Converting a transparent PNG to JPG

The image is converted to JPG simply by saving it with the correct file extension.

```
Image::load('github-logo.png')
    ->fit(Manipulations::FIT_FILL, 500, 300)
    ->background('lightblue')
    ->border(15, '007698', Manipulations::BORDER_EXPAND)
    ->save('example.jpg');
```

![Example PNG to JPG](images/example-png-to-jpg.jpg)
