Image Transforms
Manipulate images using standard resizing, scaling, and cropping operations.
QueryString API
widthconstrains the image width.wis an alias forwidthheightconstrains the image height.his an alias forheightdpris a multiplier forwidth/heightto make responsive image usage easier.modedetermines how to handle aspect ratio differences.stretchdistorts the image to be exactly the given dimensions, ifscale=both. Ifscale=down(the default), the image is only scaled ifwidthandheightare smaller than the image.padscales the image to fit withinwidthandheight, then pads 2 edges (bgcolor) to make it.cropscales the image to fit abovewidthandheight, then minimally crops to meet aspect ratio.maxscales the image to fit withinwidthandheight
scalecontrols whether images are upsampled or not.down- Never upscale an image - return at original size insteadboth- Downscale or upscale to meet size requirements. Image enlargement causes blurriness and should be avoided.canvas- Add padding instead of upscaling to meet size requirements.up- Never downscale, only upscale to meet requirements. Rarely used.
anchordetermines how the image is aligned when you usemode=crop,mode=padorscale=canvas. The default ismiddlecentervalues are
topleft,topcenter,topright,middleleft,middlecenter,middleright,bottomleft,bottomcenter, andbottomright.
sflipflips the source image in thex,y, orxydimensions.flipflips the result image in thex,y, orxydimensions.srotaterotates the source image90,180, or270degrees.rotaterotates the result image90,180, or270degrees.crop=x1,y1,x2,y2crops the source image to the given coordinates. If x2 or y2 are negative, they are relative to the bottom-right corner of the image.crop=10,10,-10,-10removes 10 pixels from the edge of the image.cropxunits=100&cropyunits=100makes thecropcoordinates percentages of the image instead of pixels.trim.threshold=80specifies a threshold to use for trimming whitespace.trim.percentpadding=0.5specifies percentage of padding to restore after trimming.bgcolormust be in the form RGB, RGBA, RRGGBBAA, RRGGBB, or be a named color.bgcolordetermines the color of padding added withmode=padorscale=canvas.ignoreicc=truecauses the source image's color profile to be ignored and treated as sRGB.ignore_icc_errors=truecauses color profile errors to be ignored rather than causing the operation to fail.
Last updated
Was this helpful?