Options
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061type Options struct {
Blur BlurMode
Brightness int
Bw BWMode
Contrast int
Dpr float32
Enable EnableOpt
Frame uint32
Height PixelsOrPercentage
Optimize OptimizeLevel
Orient Orientation
Quality uint32
ResizeFilter ResizeAlgorithm
Saturation int
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
RegionRegion indicates where image transformations will occur. Must be set.
The chosen region should be close to your origin.
Auto
AutoAuto requests an output format based on the Accept header.
BgColor
*HexColorBgColor Sets a background color when replacing transparent pixels
or with pad or canvas.
Blur
BlurModeBlur blurs the image.
Bw
BWModeBw converts image to black and white duotone.
Canvas
*CanvasCanvas adds a canvas surrounding the image.
Crop
*Crop/ Crop crops the image.
Dps is the ratio between physical and logical pixels, a float between 0-10.
Adjusts any resize requests according to this ratio.
Enable
EnableOptEnable Allows for various image transformations to occur, particularly upscaling images.
Fit
FitFit describes how the image should fit within the requested dimensions.
Format
FormatFormat re-encodes the image to a given output format.
Frame requests a single frame for an animated image.
Currently only supported for animated GIFs.
Height
PixelsOrPercentageHeight adjusts image height.
Level
LevelLevel configures GIF to MP4 conversions.
See https://www.fastly.com/documentation/reference/io/level/ for detailed information.
Metadata
MetadataMetadata preserves metadata on the input image.
Optimize
OptimizeLevelOptimize attempts to select an output quality to optimize the image.
Orient
OrientationOrient controls how the image will be oriented.
Pad
*SidesPad adds pixels surrounding the image.
Precrop
*CropPrecrop applies the crop instruction before all other parameters.
Profile
ProfileProfile is For use with GIF to MP4 conversions.
See https://www.fastly.com/documentation/reference/io/level/ for detailed information.
ResizeFilter
ResizeAlgorithmSharpen
*SharpenSharpen applies an unsharp mask to the image.
Trim
*SidesTrim removes pixels from the image on all sides.
TrimColor
*TrimColorTrimColor trims the image on all sides based on a given color.
Width
PixelsOrPercentageWidth adjusts image width.
/ If true, preserves query parameters not belonging to the / Image Optimizer API when requesting the origin image.