backup — backups current image state

Description

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.

Parameters

name (optional)

The name of the backup in memory. Default: default

Return Values

Instance of Intervention\Image\Image

Examples

  1. // create empty canvas with black background
  2. $img = Image::canvas(120, 90, '#000000');
  3. // fill image with color
  4. $img->fill('#b53717');
  5. // backup image with colored background
  6. $img->backup();
  7. // fill image with tiled image
  8. $img->fill('tile.png');
  9. // return to colored background
  10. $img->reset();

See also