imageopto

Modulecompute-sdk-go v1.10.0

github.com/fastly/compute-sdk-go/fsthttp/imageopto

Structs

AreaArea is an image area.
BlurModeBlurMode specifies the Gaussian Blur to apply to the image.
BWModeBWMode specifies how the image should be converted to black and white duotone.
CanvasCanvas is the size of an image canvas.
CropCrop removes pixels from an image.
HexColorHexColor is a hex color
OptionsOptions contains options that correspond to the public ImageOptimzation API.
PositionPosition is a position within an image.
SharpenSharpen specifies options for increasing the definition of the edges of objects in an image.
SidesSides specifies a border around an image for adding or removing pixels.
TrimColorTrimColor identifies a rectangular border based on specified color and removes this / border from the edges of an image.

Enums

AutoAuto enables optimizations based on content negotiation.
EnableOptEnableOpt specifies features that are disabled by default, but can be requested to be enabled.
FitFit controls how the image will be constrained within the provided size (width and height) values, in order to maintain the correct proportions.
FormatFormat is the desired output encoding for the image.
LevelLevel specifies a set of constraints indicating a degree of required decoder performance for a profile.
MetadataMetadata controls what metadata to preserve in the image.
OptimizeLevelOptimizeLevel specifies the desired level of image compression.
Orientation/ Orientation specifies the cardinal orientation of the image.
ProfileProfile specifies features the video encoder can use based on a target class of application for decoding the specific video bitstream.
RegionRegion sets the region for image transformation.
ResizeAlgorithm/ ResizeAlgorithm specifies the resizing filter used to generate a new image with a higher or lower / number of pixels.

Type aliases

CropModeCropMode determines cropping behavior.
PixelsOrPercentagePixelsOrPercentage specifies a length as either pixels or a percentage.
PointOrOffsetPointOrOffset specifies a position along an axis

Functions

NewAreaAspectRatioNewAreaAspectRatio specifies an area with the given width/height aspect ratio.
NewAreaWidthHeightNewAreaWidthHeight specifies an area with precise number of pixels.
NewBlurModePercentageNewBlurModePercentage returns a new BlurMode with a blur radius as a percentage of the image size.
NewBlurModePixelsNewBlurModePixels returns a new BlurMode with a blur radius in pixels.
NewBWModeAtkinsonNewBWModeAtkinston returns a BWMode for Atkinson dithering.
NewBWModeDefaultThresholdNewBWModeDefaultThreshold returns a BWMode for default threshold dithering.
NewBWModeThresholdNewBWModeThreshold returns a BWMode for default threshold dithering with a specified luminance.

Constants

AutoAVIF

Autoread-onlyView source

Default: "avif"

AutoWebP

Autoread-onlyView source

Default: "webp"

CropModeSafe

untyped stringread-onlyView source

Default: "safe"

CropModeSafe avoids invalid parameter errors and return an image.

By default, if the specified cropped region is outside the bounds of the image, then the transformation will fail with the error "Invalid transformation for requested image: Invalid crop, region out of bounds". This option will instead deliver the image as an intersection of the origin image and the specified cropped region. This avoids the error, but the resulting image may not be of the specified dimensions.

CropModeSmart

untyped stringread-onlyView source

Default: "smart"

CropModeSmart enables content-aware algorithms to attempt to crop the image to the desired aspect ratio while intelligently focusing on the most important visual content, including the detection of faces.

EnableOptUpscale

EnableOptread-onlyView source

Default: "upscale"

/ EnableOptUpscale allows images to be resized such that the output image's dimensions are / larger than the source image.

FitBounds

Fitread-onlyView source

Default: "bounds"

FitBounds resizes the image to fit entirely within the specified region, making one dimension smaller if needed.

FitCover

Fitread-onlyView source

Default: "cover"

FitCover resizes the image to entirely cover the specified region, making one dimension larger if needed.

FitCrop

Fitread-onlyView source

Default: "crop"

FitCrop resizes and crops the image centrally to exactly fit the specified region.

FormatAVIF

Formatread-onlyView source

Default: "avif"

FormatAuto

Formatread-onlyView source

Default: "auto"

FormatGIF

Formatread-onlyView source

Default: "gif"

FormatJPEG

Formatread-onlyView source

Default: "jpeg"

FormatJPEGXL

Formatread-onlyView source

Default: "jpegxl"

FormatMP4

Formatread-onlyView source

Default: "mp4"

FormatPNG

Formatread-onlyView source

Default: "png"

FormatWebP

Formatread-onlyView source

Default: "webp"

Level1_0

Levelread-onlyView source

Default: "1.0"

Level1_1

Levelread-onlyView source

Default: "1.1"

Level1_2

Levelread-onlyView source

Default: "1.2"

Level1_3

Levelread-onlyView source

Default: "1.3"

Level2_0

Levelread-onlyView source

Default: "2.0"

Level2_1

Levelread-onlyView source

Default: "2.1"

Level2_2

Levelread-onlyView source

Default: "2.2"

Level3_0

Levelread-onlyView source

Default: "3.0"

Level3_1

Levelread-onlyView source

Default: "3.1"

Level3_2

Levelread-onlyView source

Default: "3.2"

Level4_0

Levelread-onlyView source

Default: "4.0"

Level4_1

Levelread-onlyView source

Default: "4.1"

Level4_2

Levelread-onlyView source

Default: "4.2"

Level5_0

Levelread-onlyView source

Default: "5.0"

Level5_1

Levelread-onlyView source

Default: "5.1"

Level5_2

Levelread-onlyView source

Default: "5.2"

Level6_0

Levelread-onlyView source

Default: "6.0"

Level6_1

Levelread-onlyView source

Default: "6.1"

Level6_2

Levelread-onlyView source

Default: "6.2"

MetadataCopyright

Metadataread-onlyView source

Default: "copyright"

/ MetadataCopyright preserves copyright notice, creator, credit line, licensor, and web statement of rights / fields.

OptimizeLevelHigh

OptimizeLevelread-onlyView source

Default: "high"

OptimizeLevelHigh means minor visual artifacts may be visible. This produces the smallest file.

OptimizeLevelLow

OptimizeLevelread-onlyView source

Default: "low"

OptimizeLevelLow means the output image quality will be similar to the input image quality.

OptimizeLevelMedium

OptimizeLevelread-onlyView source

Default: "medium"

OptimizeLevelMedium means more optimization is allowed, while attempting to preserve the visual quality of the input image.

OrientationDefault

Orientationread-onlyView source

Default: 1

OrientationFlipHorizontal

Orientationread-onlyView source

Default: 2

OrientationFlipHorizontalAndVertical

Orientationread-onlyView source

Default: 3

OrientationFlipHorizontalOrientLeft

Orientationread-onlyView source

Default: 5

OrientationFlipHorizontalOrientRight

Orientationread-onlyView source

Default: 7

OrientationFlipVertical

Orientationread-onlyView source

Default: 4

OrientationOrientLeft

Orientationread-onlyView source

Default: 8

OrientationOrientRight

Orientationread-onlyView source

Default: 6

ProfileBaseline

Profileread-onlyView source

Default: "baseline"

/ ProfileBaseline is the profile recommended for video conferencing and mobile applications.

ProfileHigh

Profileread-onlyView source

Default: "high"

/ ProfileHigh is the profile recommended for high-definition broadcasts.

ProfileMain

Profileread-onlyView source

Default: "main"

/ ProfileMain is the profile recommended for standard-definition broadcasts.

RegionAsia

Regionread-onlyView source

Default: "asia"

RegionAustralia

Regionread-onlyView source

Default: "australia"

RegionEuCentral

Regionread-onlyView source

Default: "eu_central"

RegionEuWest

Regionread-onlyView source

Default: "eu_west"

RegionUsCentral

Regionread-onlyView source

Default: "us_central"

RegionUsEast

Regionread-onlyView source

Default: "us_east"

RegionUsWest

Regionread-onlyView source

Default: "us_west"

ResizeAlgorithmBicubic

ResizeAlgorithmread-onlyView source

Default: "bicubic"

ResizeAlgorithmBicubic uses an average of a 4x4 environment of pixels, weighing the innermost pixels higher.

ResizeAlgorithmBilinear

ResizeAlgorithmread-onlyView source

Default: "bilinear"

ResizeAlgorithmBilear uses an average of a 2x2 environment of pixels.

ResizeAlgorithmLanczos2

ResizeAlgorithmread-onlyView source

Default: "lanczos2"

ResizeAlgorithmLanczos2 uses the Lanczos filter to increase the ability to detect edges and linear features within an image and uses sinc resampling to provide the best possible reconstruction.

ResizeAlgorithmLanczos3

ResizeAlgorithmread-onlyView source

Default: "lanczos3"

ResizeAlgorithmLanczos3 uses a better approximation of the sinc resampling function.

ResizeAlgorithmNearest

ResizeAlgorithmread-onlyView source

Default: "nearest"

ResizeAlgorithmNearest uses the value of nearby translated pixel values.