Save a backup of the current image state

2.7M Downloads / Month

Open Source MIT License

You are viewing the documentation for Intervention Image 2, this version has reached EOL. Please consider upgrading to version 3.

public Intervention\Image\Image backup([string $name])

Backups current image state as fallback for reset method under an optional name. Overwrites older state on every call, unless a different name is passed.


name (optional)

The name of the backup in memory. Default: default

Return Values

Instance of Intervention\Image\Image


// create empty canvas with black background
$img = Image::canvas(120, 90, '#000000');

// fill image with color

// backup image with colored background

// fill image with tiled image

// return to colored background

See also