---
application: "Intervention Image"
version: "Version 2"
status: "eol"
---

# Image::destroy

## Free up memory



> public Intervention\Image\Image destroy()

Frees memory associated with the current image instance **before** the PHP script ends. Normally resources are destroyed automatically **after** the script is finished.

Of course, the image instance is no longer usable after the method has been called.

### Parameters
none

### Return Values
none

### Examples

```php
// create an image
$img = Image::make('public/foo.jpg');

// perform some modifications
$img->resize(320, 240);
$img->save('public/small.jpg');

// destroy resource
$img->destroy();
```

---

## 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)