Image operations
Basic image resizing operations
Resizing operations enable the dynamic generation of image transformations to meet various web delivery use cases. Operations focus on the image size while Image filters allow to modify the image itself.
Most of the on-the-fly image transformations can be configured using the Asset Variation Builder, an in-line URL builder to preview each image transformation instantly.
Available operations
org_if_sml=1
prevents upscaling if any of the target dimensions is larger than the origin image
func=crop
resizes the image to the desired dimensions without distorting it while cropping out portions of the image if necessary, to achieve the desired aspect ratio. You need to also provide both width and height
gravity=X
defines the desired "focal point" of the image. Used with func=crop, this will set the part of the image which will be retained. With the func=fit resize mode, it will set the placement of the image within the new canvas X = [north | south][east | west] | auto | smart | trim | X,Y
tl_px=X,Y
defines the coordinates of the top left corner of the cropping rectangle when performing positionable crop
br_px=X,Y
sets coordinates of the bottom right corner of the cropping rectangle when performing positionable crop
func=face
crops the image automatically focusing on the most prominent face in the image (if a face is detected)
func=fit
resizes the image to the desired dimensions without distorting it by increasing the image canvas if necessary, to achieve the desired aspect ratio
margin=X
sets the minimum margin when using the fit resize mode
func=cropfit
resizes the image while automatically choosing between the crop and fit resize modes depending on the origin image dimensions, the desired dimensions, and the other parameters in the transformation URL
func=bound
resizes the image to dimensions no larger than the ones specified in the transformation URL. The resulting image might not match both width and height depending on the desired aspect ratio
func=boundmin
resizes the image to dimensions no larger than the larger one specified in the transformation URL. The resulting image might not match both width and height depending on the desired aspect ratio
func=cover
resizes the image to the set width and hight while ignoring the origin aspect ratio (image might be distorted)
radius=X
rounds the corners of the image while optionally fills the empty background with a chosen color
Resize functions
When you resize an image by specify both width and height, the original image proportions can be either ignored or maintained. You may also choose to add padding to the image to fill the blank space (extending the canvas).
Cloudimage supports the following resize functions (defined with the func parameter):
Crop
Keeps image proportions, cutting the image to fit the defined width and height; see Crop
This resizing function removes parts of the image and is the default behavior when both width and height are defined. Read further for other resizing functions.
Fit
Resizes the image, keeping proportions and extending the canvas (by adding padding) to satisfy the desired dimensions; see Fit
Cropfit
Performs either Cropor Fit based on the image dimensions, aspect ratio and transformation parameters; see Cropfit
This resizing function may remove (crop out) parts of the image.
650x500 origin image, resolves to "crop": /samples.scaleflex.com/classroom.jpg?func=cropfit&w=500&h=350&bg_colour=auto
Same parameters, 400x250 origin image, resolves to "fit": /samples.scaleflex.com/ny_doc.jpg?func=cropfit&w=500&h=350&bg_colour=auto
Bound
Fits image in a box of defined size without adding padding; see Bound
Cover
Resizes the image to the given width and height, ignoring original image proportions, thus distorting the image; see Cover
Last updated
Was this helpful?