Image::canvas
Create a new empty image resource
2.7M Downloads / Month
Open Source MIT License
2.7M Downloads / Month
Open Source MIT License
public Intervention\Image\ImageManager canvas(integer $width, integer $height, [mixed $bgcolor])
Factory method to create a new empty image instance with given width and height. You can define a background-color optionally. By default the canvas background is transparent.
Width of the new image resource.
Height of the new image resource.
Optional Background-color of the image resource. Pass a color in one of the supported color formats or just leave it blank to get a transparent background.
Instance of Intervention\Image\Image
// create a new empty image resource with transparent background
$img = Image::canvas(800, 600);
// create a new empty image resource with red background
$img = Image::canvas(32, 32, '#ff0000');