---
title: image_optimizer
summary: Interface to the Fastly Image Optimizer.
url: https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/
---

**Kind:** Module  
**Package:** fastly 0.13.1  
**Path:** `fastly::image_optimizer`

Interface to the Fastly Image Optimizer.

The Fastly [Image Optimizer](https://docs.fastly.com/products/image-optimizer) is a real-time image transformation and optimization
service that caches and serves pixel-optimized, bandwidth-efficient images requested
from your origin server.

Note that this functionality is in beta. Please reach out to Fastly support before
using.

This module contains parameters that express transformation options
In particular, [`ImageOptimizerOptions`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.ImageOptimizerOptions/) is used with
[`Request::set_image_optimizer`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/#method-set_image_optimizer) or
[`Request::with_image_optimizer`](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/http/request/struct.Request/#method-with_image_optimizer)
to enable Image Optimization on a request. See those methods for details on usage.

## Structs

| Name | Summary |
| --- | --- |
| [Canvas](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.Canvas/) | Specify the size of the image canvas. |
| [Crop](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.Crop/) | Remove pixels from an image. |
| [HexColor](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.HexColor/) | A hexadecimal color specification. |
| [ImageOptimizerOptions](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.ImageOptimizerOptions/) | ImageOptimizerOptions contains options that correspond to the [public API]. |
| [Position](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.Position/) | A position within an image. |
| [Sharpen](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.Sharpen/) | Options for increasing the definition of the edges of objects in an image. |
| [Sides](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.Sides/) | Parameters for adding or removing pixels from the sides of an image. |
| [TrimColor](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/struct.TrimColor/) | Identify a rectangular border based on specified color and remove this border from the edges of an image. |

## Enums

| Name | Summary |
| --- | --- |
| [Area](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.Area/) | Specify an area. |
| [Auto](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.Auto/) | Enables optimizations based on content negotiation. |
| [BlurMode](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.BlurMode/) | Applies a [Gaussian blur] filter to the image. |
| [BWMode](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.BWMode/) | Controls conversion of image to black and white duotone. |
| [CropMode](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.CropMode/) | Controls cropping behaviour. |
| [EnableOpt](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.EnableOpt/) | Features that are disabled by default, but can be requested to be enabled. |
| [Fit](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.Fit/) | The fit parameter controls how the image will be constrained within the provided size (width and height) values, in order to maintain the correct proportions. |
| [Format](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.Format/) | Specifies the desired output encoding for the image. |
| [ImageOptimizerAPIError](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.ImageOptimizerAPIError/) | Errors that can arise during construction of Image Optimizer requests. |
| [ImageOptimizerRegion](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.ImageOptimizerRegion/) | Available regions for image transformation. |
| [Level](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.Level/) | The level parameter specifies a set of constraints indicating [a degree of required decoder performance][perf] for a profile. |
| [Metadata](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.Metadata/) | Controls what metadata to preserve in images. |
| [OptimizeLevel](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.OptimizeLevel/) | The optimize parameter automatically applies optimal quality compression to produce an output image with as much visual fidelity as possible, while minimizing the file size. |
| [Orientation](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.Orientation/) | The orient parameter controls the cardinal orientation of the image. |
| [PixelsOrPercentage](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.PixelsOrPercentage/) | Specify a position along an axis in an image. |
| [PointOrOffset](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.PointOrOffset/) | Specify a position along an axis in an image. |
| [Profile](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.Profile/) | The profile parameter controls which features the video encoder can use based on a target class of application for decoding the specific video bitstream. |
| [ResizeAlgorithm](https://www.fastly.com/documentation/reference/compute/sdks/rust/fastly/image_optimizer/enum.ResizeAlgorithm/) | Enables control over the resizing filter used to generate a new image with a higher or lower number of pixels. |
