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

# Image::opacity

## Set opacity of the current image



> public Intervention\Image\Image opacity(integer $transparency)

Set the **opacity** in percent of the current image ranging from 100% for opaque and 0% for full transparency.

**Note: Performance intensive on larger images. Use with care.**

### Parameters

#### transparency
The new percent of transparency as integer for the current image.

### Return Values
Instance of `Intervention\Image\Image`

### Examples

```php
// create Image from file and set transparency to 50%
Image::make('public/foo.jpg')->opacity(50);

// create new Intervention Image from file and set image full transparent
$img = Image::make('public/foo.jpg');
$img->opacity(0);
```

### See also

- [fill](https://image.intervention.io/v2/api/fill.md)
- [mask](https://image.intervention.io/v2/api/mask.md)

---

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