---
title: Canvas
summary: Canvas is the size of an image canvas.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/fsthttp/imageopto/struct.Canvas/
---

**Kind:** Struct  
**Module:** [imageopto](https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/fsthttp/imageopto/)  
**Package:** compute-sdk-go v1.11.0  
**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/fsthttp/imageopto/imageopto.go#L468

```go
type Canvas struct {
	Size Area

	Position *Position
}
```

Canvas is the size of an image canvas.

## Fields

### Size

**Type:** `Area`

Size is the desired width and height.

### Position

**Type:** `*Position`

Position is how to distribute the remaining space around the image.

## Methods

### String

**Source:** https://github.com/fastly/compute-sdk-go/blob/d6bf71b04516ed72d6018cab6fff701a865f86e5/fsthttp/imageopto/imageopto.go#L488

```go
func (c *Canvas) String() string
```

**Returns**

`string`
