Fork me on GitHub

rotate — Rotate an image

Description

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

Rotate the current image 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 anticlockwise.

bgcolor (optional)

A background color for the uncovered zone after the rotation. The background color can be passed in in different color formats. Default: #000000

Return Values

Instance of Intervention\Image\Image

Examples

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

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

See also