Advanced manipulations | image | Spatie

 SPATIE

  Image
========

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Image](https://spatie.be/docs/image/v2)  Usage  Advanced manipulations

 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                                                                                                                                                                                                                                    `

Advanced manipulations
======================

###  On this page

1. [ The ](#content-the-apply-method)

By default every manipulation will only be applied once to your image. When calling a manipulation method multiple times only the last call will be applied when the image is saved.

### Example usage

```
// This will only lower the brightness by 20%
Image::load('example.jpg')
    ->brightness(-40)
    ->brightness(-20)
    ->save();
```

![Example](../images/example-brightness.jpg)

The `apply` method
----------------------------------------------------------------------------------------------------------

The `apply` method will apply all previous manipulations to the image before continuing with the next manipulations.

### Example usage

```
// This will lower the brightness by 40%, then lower it again by 20%
Image::load('example.jpg')
    ->brightness(-40)
    ->apply()
    ->brightness(-20)
    ->save();
```

![Example](../images/example-advanced-manipulations.jpg)
