---
application: "Intervention Image"
version: "Version 4"
status: "stable"
---

# Advanced

## Advanced Image Modification

Discover the endless possibilities of Intervention Image by directly accessing the native image data and combining them with custom modifier classes.


If the supplied options are not sufficient, it is possible to create your own
solutions using your own [custom extensions](https://image.intervention.io/v4/modifying-images/custom-extensions.md).
Furthermore, the native image object can be accessed, so that all functions
used by the actual image processing libraries (such as GD or Imagick) can
be used — even those not covered by Intervention Image.

## Access the Native Image Object

Depending on the driver, each image object is mapped internally by either an
instance of a `GDImage::class` or an `Imagick::class` object. The parent image object of
Intervention Image provides access to this base object.

The following example uses the native Imagick function
[oilPaintImage()](https://www.php.net/manual/en/imagick.oilpaintimage.php),
which is not included in this library.

```php
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Imagick\Driver;

// read test image from a file
$image = ImageManager::usingDriver(Driver::class)->decode('test.png');

// access Imagick instance directly
$imagick = $image->core()->native();

// use Imagick method
$imagick->oilPaintImage(4.5);
```

Combined with [custom extensions](https://image.intervention.io/v4/modifying-images/custom-extensions.md), Intervention
Image can be extended with your own modifier combinations for endless
possibilities.

## Batch Modifications

The `Intervention\Image\ModifierStack` class allows you to group existing modifiers together and process them in a single call.

This can be helpful when you need to group individual calls into reusable units without having to create a [custom modifier](https://image.intervention.io/v4/modifying-images/custom-extensions.md) class for that purpose.

```php
use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\ImageManager;
use Intervention\Image\ModifierStack;
use Intervention\Image\Modifiers\BrightnessModifier;
use Intervention\Image\Modifiers\ContrastModifier;
use Intervention\Image\Modifiers\GrayscaleModifier;

$image = ImageManager::usingDriver(Driver::class)
    ->decodePath('example.jpg');

// black and white high contrast stack
$stack = new ModifierStack([
    new GrayscaleModifier(),
    new BrightnessModifier(20),
    new ContrastModifier(12),
]);

$image->modify($stack);
```

---

## Become a Sponsor

### Intervention Image needs your help to keep the project going

Intervention Image is non-commercial, open source licensed and completely free to use. The considerable
effort required to maintain and develop the software is only possible with the financial support
of sponsors. There are two ways in which you can support this project.

- Support via [GitHub Sponsors](https://github.com/sponsors/Intervention)
- Support via [Ko-Fi](https://ko-fi.com/interventionphp)