imageopto
github.com/fastly/compute-sdk-go/fsthttp/imageopto
Structs
| Area | Area is an image area. |
| BlurMode | BlurMode specifies the Gaussian Blur to apply to the image. |
| BWMode | BWMode specifies how the image should be converted to black and white duotone. |
| Canvas | Canvas is the size of an image canvas. |
| Crop | Crop removes pixels from an image. |
| HexColor | HexColor is a hex color |
| Options | Options contains options that correspond to the public ImageOptimzation API. |
| Position | Position is a position within an image. |
| Sharpen | Sharpen specifies options for increasing the definition of the edges of objects in an image. |
| Sides | Sides specifies a border around an image for adding or removing pixels. |
| TrimColor | TrimColor identifies a rectangular border based on specified color and removes this / border from the edges of an image. |
Enums
| Auto | Auto enables optimizations based on content negotiation. |
| EnableOpt | EnableOpt specifies features that are disabled by default, but can be requested to be enabled. |
| Fit | Fit controls how the image will be constrained within the provided size (width and height) values, in order to maintain the correct proportions. |
| Format | Format is the desired output encoding for the image. |
| Level | Level specifies a set of constraints indicating a degree of required decoder performance for a profile. |
| Metadata | Metadata controls what metadata to preserve in the image. |
| OptimizeLevel | OptimizeLevel specifies the desired level of image compression. |
| Orientation | / Orientation specifies the cardinal orientation of the image. |
| Profile | Profile specifies features the video encoder can use based on a target class of application for decoding the specific video bitstream. |
| Region | Region 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
| CropMode | CropMode determines cropping behavior. |
| PixelsOrPercentage | PixelsOrPercentage specifies a length as either pixels or a percentage. |
| PointOrOffset | PointOrOffset specifies a position along an axis |
Functions
| NewAreaAspectRatio | NewAreaAspectRatio specifies an area with the given width/height aspect ratio. |
| NewAreaWidthHeight | NewAreaWidthHeight specifies an area with precise number of pixels. |
| NewBlurModePercentage | NewBlurModePercentage returns a new BlurMode with a blur radius as a percentage of the image size. |
| NewBlurModePixels | NewBlurModePixels returns a new BlurMode with a blur radius in pixels. |
| NewBWModeAtkinson | NewBWModeAtkinston returns a BWMode for Atkinson dithering. |
| NewBWModeDefaultThreshold | NewBWModeDefaultThreshold returns a BWMode for default threshold dithering. |
| NewBWModeThreshold | NewBWModeThreshold returns a BWMode for default threshold dithering with a specified luminance. |
Constants
Default: "avif"
Default: "webp"
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.
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.
Default: "upscale"
/ EnableOptUpscale allows images to be resized such that the output image's dimensions are / larger than the source image.
Default: "bounds"
FitBounds resizes the image to fit entirely within the specified region, making one dimension smaller if needed.
Default: "cover"
FitCover resizes the image to entirely cover the specified region, making one dimension larger if needed.
Default: "crop"
FitCrop resizes and crops the image centrally to exactly fit the specified region.
Default: "avif"
Default: "auto"
Default: "gif"
Default: "jpeg"
Default: "jpegxl"
Default: "mp4"
Default: "png"
Default: "webp"
Default: "1.0"
Default: "1.1"
Default: "1.2"
Default: "1.3"
Default: "2.0"
Default: "2.1"
Default: "2.2"
Default: "3.0"
Default: "3.1"
Default: "3.2"
Default: "4.0"
Default: "4.1"
Default: "4.2"
Default: "5.0"
Default: "5.1"
Default: "5.2"
Default: "6.0"
Default: "6.1"
Default: "6.2"
Default: "copyright"
/ MetadataCopyright preserves copyright notice, creator, credit line, licensor, and web statement of rights / fields.
Default: "high"
OptimizeLevelHigh means minor visual artifacts may be visible. This produces the smallest file.
Default: "low"
OptimizeLevelLow means the output image quality will be similar to the input image quality.
Default: "medium"
OptimizeLevelMedium means more optimization is allowed, while attempting to preserve the visual quality of the input image.
Default: 1
Default: 2
Default: 3
Default: 5
Default: 7
Default: 4
Default: 8
Default: 6
Default: "baseline"
/ ProfileBaseline is the profile recommended for video conferencing and mobile applications.
Default: "high"
/ ProfileHigh is the profile recommended for high-definition broadcasts.
Default: "main"
/ ProfileMain is the profile recommended for standard-definition broadcasts.
Default: "asia"
Default: "australia"
Default: "eu_central"
Default: "eu_west"
Default: "us_central"
Default: "us_east"
Default: "us_west"
Default: "bicubic"
ResizeAlgorithmBicubic uses an average of a 4x4 environment of pixels, weighing the innermost pixels higher.
Default: "bilinear"
ResizeAlgorithmBilear uses an average of a 2x2 environment of pixels.
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.
Default: "lanczos3"
ResizeAlgorithmLanczos3 uses a better approximation of the sinc resampling function.
Default: "nearest"
ResizeAlgorithmNearest uses the value of nearby translated pixel values.