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

# Image::canvas

## Create a new empty image resource



> 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.

### Parameters

#### width
Width of the new image resource.

#### height
Height of the new image resource.

#### bgcolor (optional)
Optional Background-color of the image resource. Pass a color in one of the supported [color formats](https://image.intervention.io/v2/getting-started/formats.md) or just leave it blank to get a transparent background.


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

### Examples

```php
// 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');
```


### See also

- [make](https://image.intervention.io/v2/api/make.md)
- [cache](https://image.intervention.io/v2/api/cache.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)