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

# Image::rotate

## Rotate the current image



> public Intervention\Image\Image rotate(float $angle, [string $bgcolor])

Rotate the current image counter-clockwise by a given **angle**. Optionally define a **background color** for the uncovered zone after the rotation.

### Parameters

#### angle
The rotation angle in degrees to rotate the image counter-clockwise.

#### bgcolor (optional)
A background color for the uncovered zone after the rotation. The background color can be passed in different [color formats](https://image.intervention.io/v2/getting-started/formats.md). Default: `#ffffff`, transparent if supported by the output format


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

### Examples

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

// rotate image 45 degrees clockwise
$img->rotate(-45);
```

### See also

- [flip](https://image.intervention.io/v2/api/flip.md)
- [resize](https://image.intervention.io/v2/api/resize.md)
- [resizeCanvas](https://image.intervention.io/v2/api/resize-canvas.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)