---
title: Options
summary: Options contains options that correspond to the public ImageOptimzation API.
url: https://www.fastly.com/documentation/reference/compute/sdks/go/compute-sdk-go/fsthttp/imageopto/struct.Options/
---

**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#L641

```go
type Options struct {
	Region Region

	Auto Auto

	BgColor *HexColor

	Blur BlurMode

	Brightness int

	Bw BWMode

	Canvas *Canvas

	Contrast int

	Crop *Crop

	Dpr float32

	Enable EnableOpt

	Fit Fit

	Format Format

	Frame uint32

	Height PixelsOrPercentage

	Level Level

	Metadata Metadata

	Optimize OptimizeLevel

	Orient Orientation

	Pad *Sides

	Precrop *Crop

	Profile Profile

	Quality uint32

	ResizeFilter ResizeAlgorithm

	Saturation int

	Sharpen *Sharpen

	Trim *Sides

	TrimColor *TrimColor

	Width PixelsOrPercentage

	PreserveQueryStringOnOriginRequest bool
}
```

Options contains options that correspond to the public ImageOptimzation API.

For more details, see https://www.fastly.com/documentation/reference/io/

## Fields

### Region

**Type:** `Region`

Region indicates where image transformations will occur. Must be set.

The chosen region should be close to your origin.

### Auto

**Type:** `Auto`

Auto requests an output format based on the `Accept` header.

### BgColor

**Type:** `*HexColor`

BgColor Sets a background color when replacing transparent pixels
or with `pad` or `canvas`.

### Blur

**Type:** `BlurMode`

Blur blurs the image.

### Brightness

**Type:** `int`

Brightness adjusts image brightness.

### Bw

**Type:** `BWMode`

Bw converts image to black and white duotone.

### Canvas

**Type:** `*Canvas`

Canvas adds a canvas surrounding the image.

### Contrast

**Type:** `int`

Contrast adjusts image contrast.

### Crop

**Type:** `*Crop`

/ Crop crops the image.

### Dpr

**Type:** `float32`

Dps is the ratio between physical and logical pixels, a float between 0-10.

Adjusts any resize requests according to this ratio.

### Enable

**Type:** `EnableOpt`

Enable Allows for various image transformations to occur, particularly upscaling images.

### Fit

**Type:** `Fit`

Fit describes how the image should fit within the requested dimensions.

### Format

**Type:** `Format`

Format re-encodes the image to a given output format.

### Frame

**Type:** `uint32`

Frame requests a single frame for an animated image.

Currently only supported for animated GIFs.

### Height

**Type:** `PixelsOrPercentage`

Height adjusts image height.

### Level

**Type:** `Level`

Level configures GIF to MP4 conversions.

See <https://www.fastly.com/documentation/reference/io/level/> for detailed information.

### Metadata

**Type:** `Metadata`

Metadata preserves metadata on the input image.

### Optimize

**Type:** `OptimizeLevel`

Optimize attempts to select an output quality to optimize the image.

### Orient

**Type:** `Orientation`

Orient controls how the image will be oriented.

### Pad

**Type:** `*Sides`

Pad adds pixels surrounding the image.

### Precrop

**Type:** `*Crop`

Precrop applies the crop instruction before all other parameters.

### Profile

**Type:** `Profile`

Profile is For use with GIF to MP4 conversions.

See <https://www.fastly.com/documentation/reference/io/level/> for detailed information.

### Quality

**Type:** `uint32`

Quality requests an output quality.

### ResizeFilter

**Type:** `ResizeAlgorithm`

### Saturation

**Type:** `int`

Saturation adjusts image saturation.

### Sharpen

**Type:** `*Sharpen`

Sharpen applies an unsharp mask to the image.

### Trim

**Type:** `*Sides`

Trim removes pixels from the image on all sides.

### TrimColor

**Type:** `*TrimColor`

TrimColor trims the image on all sides based on a given color.

### Width

**Type:** `PixelsOrPercentage`

Width adjusts image width.

### PreserveQueryStringOnOriginRequest

**Type:** `bool`

/ If true, preserves query parameters not belonging to the
/ Image Optimizer API when requesting the origin image.

## Methods

### QueryString

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

```go
func (o *Options) QueryString() (string, error)
```

**Returns**

`(string, error)`
