LogoLogo
BlogHelp CenterPrivacyLoginRegister
  • Let's optimize your images
  • Transformations
    • Input formats
    • Image operations
      • Width and height
      • Prevent enlargement
      • Crop
        • Automatic gravity crop
        • Positionable crop
        • Focal point crop
        • Face crop
        • Face hide
        • Aspect ratio crop
      • Fit
      • Cropfit
      • Bound
      • Boundmin
      • Cover
      • Device pixel ratio
      • Flip
      • Rotate
      • Trim
      • Rounded corners
      • Background removal
    • Image filters
      • Adjustment
        • Brightness
        • Contrast
        • Saturate
      • Color manipulation
        • Color overlay
        • Grayscale
        • Duotone
        • Sepia
        • Invert
      • Blur
      • Pixelate
      • Sharpen
      • Face blur
    • Image watermarking
      • Static watermark
      • Dynamic watermark
      • Text watermark
        • Text watermark fonts
    • Image compression
      • Image formats
      • Optipress
      • SVG compression
      • Color management
    • Static content
      • PDF to image
      • JS/CSS optimization
    • Video operations
  • Setup
    • Shortening URLs
      • Origin URL prefix
      • Aliases
      • Presets
      • Rules
    • Connecting storage bucket
      • Amazon S3
      • Google Cloud Storage
      • Microsoft Azure Blob
      • Basic authentication HTTP
    • Security
      • Token security
        • Domain whitelisting
        • URL signature
        • URL sealing
      • Account security
      • Origin security
  • Implementation
    • URL API implementation
    • Responsive images JS plugin
    • CMS plugins
      • Spryker
      • Drupal
      • Kontent.ai
      • Contentful
      • Adobe Commerce (Magento)
        • Basic implementation
        • Advanced implementation
      • Opencart
      • Prestashop
        • Prestashop tutorial
      • Shopware
      • Sylius
      • Wordpress
      • Shopify tutorial
        • Shopify integration
        • Theme files
        • FAQ
      • Commercetools tutorial
      • Ruby wrapper
    • Migrating from another image CDN
  • Caching and acceleration
    • CDN basics
    • Caching interval
    • Invalidation API
    • Warmup API
  • Analytics
    • Dashboards
      • Overview
      • Volumetry
      • Optimization
      • Delivery
      • Top-Ranking
      • RUM
      • Logs API
  • Cloudimage_v6 EOL
Powered by GitBook
LogoLogo

Resources

  • Help center
  • Contact support
  • Developers
  • cloudimage.io

Solutions

  • Media optimization
  • DAM
  • Performance report

Company

  • Blog
  • Service status
  • About us

Legal stuff

  • Terms & conditions
  • Privacy center
  • DMCA

Copyright © 2023 Scaleflex

On this page
  • Available operations
  • Resize functions
  • Crop
  • Fit
  • Cropfit
  • Bound
  • Cover

Was this helpful?

Export as PDF
  1. Transformations

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.

Available operations

Operation
Syntax
Description

width=X

sets the image width to X pixels

height=X

sets the image height to X pixels

org_if_sml=1

prevents resizing if the target size is larger than the origin image

func=crop

behaviorsets crop resize function

gravity=X

defines the part of the image to be retained when cropping X = [north | south][east | west] | auto | X,Y

tl_px=X,Y

sets coordinates of the top left corner of the cropping rectangle

br_px=X,Y

sets coordinates of the bottom right corner of the cropping rectangle

func=face

crops the image automatically focusing on the most prominent face

func=fit

sets fit resize function

func=cropfit

sets crop or fit resize function depending on the origin and the desired dimensions

func=bound

sets bound resize function

func=boundmin

bounds the image to the larger dimension

func=cover

sets cover resize function (distorts image proportions)

flip=[h][v]

mirrors the image horizontally and/or vertically

r=X

rotates the image to X degrees (counterclockwise)

trim=X

trims any solid-color border (if present); X is the aggressiveness of the operation

radius=X

applies rounded corners and optionally fills the empty background with a color

Resize functions

When you specify width and height, original image proportions can be ignored or maintained. You may also choose to add padding to the image to fill the blank space.

Cloudimage supports the following resize function (operation func):

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 behaviour when both width and height are defined. Read further for other resizing functions.

Preview
Syntax

Fit

Resizes the image, keeping proportions and adding padding to satisfy the desired dimensions; see Fit

Preview
Syntax

Cropfit

Performs either Cropor Fit based on image dimensions and transformation parameters; see Cropfit

This resizing function may remove parts of the image.

Preview
Syntax

Bound

Fits image in a box of defined size without adding padding; see Bound

Preview
Syntax

The boundmin operation is a special case of bound where the smaller dimension is respected instead of the larger one; see Boundmin

Cover

Resizes the image to the given width and height, ignoring original image proportions, thus distorting the image; see Cover

Preview
Syntax
PreviousInput formatsNextWidth and height

Last updated 9 months ago

Was this helpful?

Do not hesitate to if you need any additional operations not listed above

650x500 origin image, cropped:

Same parameters, 400x250 origin image:

For troubleshooting purposes, use the ci_info=1 operation to view details about resizing and compression, for example,

contact us
/sample.li/hotel.jpg?w=400&ci_info=1
Width and height
Width and height
Prevent enlargement
Crop
Positionable crop
Face crop
Fit
Cropfit
Bound
Boundmin
Cover
Flip
Rotate
Trim
Rounded corners
/sample.li/hotel.jpg?w=400&h=200&func=crop
/sample.li/hotel.jpg?w=400&h=200&func=fit&bg_color=000
/sample.li
/classroom.jpg?func=cropfit&w=500&h=350&bg_colour=auto
/sample/ny_doc.jpg?func=cropfit&w=500&h=350&bg_colour=auto
/sample.li/hotel.jpg?w=400&h=200&func=bound
/sample.li/hotel.jpg?w=400&h=250&func=cover