Each imgproxy processing option is a class in the SomehowDigital\ImgProxy\Option namespace. Every class has its own page with a usage example, its parameters and notes.
Options marked Pro need imgproxy Pro. See imgproxy Pro for what that means in practice.
Every option implements OptionInterface:
interface OptionInterface
public function getName () : string ;
public function getAlias () : ? string ;
public function getValues () : array ;
public function getParameters () : array ;
getParameters() returns the URL parameters as strings: booleans become 1 or 0, enums their value, and nested options their parameters. The URL uses getAlias() when there is one, and getName() otherwise. To add your own option, see Extending .
Sizing Class imgproxy Description AutoRotatearApplies the EXIF orientation of the source and removes the tag. DprdprMultiplies the resulting dimensions by a device pixel ratio, for HiDPI screens. EnlargeelAllows enlarging images that are smaller than the requested size. ExtendexExtends the image to the requested size when it is smaller, filling the new area with the background color. ExtendAspectRatioexarExtends the image to the requested aspect ratio, filling the new area with the background color. FlipflFlips the image horizontally, vertically or both. HeighthSets the height of the resulting image. MaxResultDimensionmrdLimits the larger dimension of the resulting image. MinHeightmhSets the minimum height of the resulting image. MinWidthmwSets the minimum width of the resulting image. PaddingpdAdds padding around the image, after all other transformations. ResizersSets the resizing type, size, enlarge and extend behavior in a single option. ResizingAlgorithm Pro raSets the algorithm used to resample the image. ResizingTypertDefines how the image is fitted to the requested size. RotaterotRotates the image clockwise by a multiple of 90 degrees. SizesSets width, height, enlarge and extend in a single option. TrimtRemoves the surrounding background from the image. WidthwSets the width of the resulting image. ZoomzMultiplies the resulting dimensions.
Cropping Class imgproxy Description CropcCrops the image to a size before it is resized. CropAspectRatio Pro carAdjusts the crop area to an aspect ratio. CropObjects Pro c_objCrops the image to the objects detected by imgproxy’s object detection. Gravity Partly Pro gSets the anchor for cropping and extending. GravityFocusPointgGravity on a focus point given in relative coordinates. GravityObject Pro gGravity on the objects of the given classes, as detected by imgproxy’s object detection. GravityObjectWeight Pro gGravity on detected objects, with a weight for each class. GravitySmartgGravity on the most interesting part of the image, as detected by imgproxy. ObjectsPosition Pro opPositions the detected objects within the resulting image.
Effects Class imgproxy Description Adjust Pro aSets brightness, contrast and saturation in one option. BackgroundbgFills transparent areas and padding with a color. BackgroundAlpha Pro bgaAdds an alpha channel to the background color. BlurblApplies a gaussian blur. BlurAreas Pro baBlurs rectangular areas of the image. BlurDetections Pro bdBlurs the objects found by imgproxy’s object detection. Brightness Pro brAdjusts the brightness of the image. Colorize Pro colOverlays a color on the image. Contrast Pro coAdjusts the contrast of the image. DrawDetections Pro ddDraws boxes, classes and confidences of detected objects onto the image. Duotone Pro dtConverts the image to two tones, mapping dark and light areas to two colors. Gradient Pro grOverlays a gradient that fades from transparent to a color. Monochrome Pro mcConverts the image to monochrome. PixelatepixApplies a pixelation filter. Saturation Pro saAdjusts the saturation of the image. SharpenshApplies a sharpening filter. UnsharpMasking Pro ushApplies unsharp masking.
Output Class imgproxy Description AutoQuality Pro aqPicks the quality automatically by encoding the image several times. AvifOptions Pro avifoSets AVIF encoder options. ColorProfile Pro cpConverts the image to a color profile and embeds it. DisableAnimation Pro daTreats animated images as static, using the first frame. Dpi Pro dpiReplaces the DPI metadata of the image. EnforceThumbnailethUses the thumbnail embedded in the source, when there is one. FilenamefnSets the file name used in the Content-Disposition header. Format Partly Pro fSets the output format as a processing option. FormatQualityfqSets the quality for individual output formats. JpegOptions Pro jpgoSets JPEG encoder options. KeepCopyrightkcrKeeps the copyright information when metadata is stripped. MaxBytesmbLowers the quality until the result fits in a number of bytes. PngOptions Pro pngoSets PNG encoder options. PreserveHdrphKeeps the high bit depth of HDR images instead of reducing them to 8 bits. QualityqSets the quality of the resulting image. RawrawStreams the source as it is, without processing or checks. ReturnAttachmentattMakes imgproxy answer with a Content-Disposition: attachment header, so browsers download the file. SkipProcessingskpSkips processing for sources of the given formats, when the result would keep the source format. StripColorProfilescpConverts the image to sRGB and removes its color profile. StripMetadatasmRemoves metadata, such as EXIF and IPTC, from the result. WebpOptions Pro webpoSets WebP encoder options.
Source Watermark Class imgproxy Description Watermark Partly Pro wmPlaces the watermark that is configured in imgproxy on the image. WatermarkRotate Pro wmrRotates the watermark clockwise. WatermarkShadow Pro wmshAdds a shadow to the watermark. WatermarkSize Pro wmsSets the size of the watermark. WatermarkText Pro wmtRenders a text as the watermark. WatermarkUrl Pro wmuSets the image that is used as the watermark.
Delivery Class imgproxy Description CacheBustercbAdds a value to the URL that has no effect on processing, so caches treat the result as a new resource. ExpiresexpMakes the URL expire. PresetprApplies presets that are configured in imgproxy.