<CldImage /> Examples
Basic Transformations
Cloudinary supports a wide variety of powerful transformations that allow you to not only deliver, but easily edit and build new images on the fly.
Background Removal
Remove Background
removeBackground
: Removes the background of the image using AI
Color Background
background
: Specifies a color to use as a background.
Image Background
underlay
: Specifies a public ID to use as an underlaying image.
Cropping & Resizing
Cropping
crop
: Specifies the mode to use when cropping an image based on the given dimensions.
Note: By default, CldImage uses a gravity of auto, meaning the crop will automatically position the subject in the center of the resulting image.
Cloudinary additionally supports dynamic crop modes like thumb
that may provide a different result based on the given width and height. To help provide more options for controlling cropping images, you can specify and object or array of objects.
For instance, to crop the original source image, which will then later resize it to the initial width and height, you can use:
Which will provide a consistent crop for all rendered sizes.
You can also use coordinates to crop to the exact location you need:
Extract
extract
: Extracts an area or multiple areas of an image, described in natural language.
Generative Fill
fillBackground
: Fills the background of an image using Generative AI
Generative Recolor
recolor
: Recolors an object in an image using Generative AI
Generative Remove
remove
: Removes an object in an image using Generative AI
Generative Replace
replace
: Replaces an object in an image using Generative AI
Generative Restore
restore
: Restores an image using Generative AI.
Before:
After:
Generative Replace Background
Uses generative AI to replace the background of your image. It can either generate a background for you based on context, or take in a prompt.
Contextual Replace
Prompt
You can also pass in a seed to the prompt:
Filters & Effects
Included in the Cloudinary transformations library are different filters and effects that allow you to recolor, improve, fix, and artistically transform your images.
Blur
blur
: Applies a blurring filter to an asset.
Grayscale
grayscale
: Converts an image to grayscale (multiple shades of gray).
Opacity
opacity
: Controls the opacity level of an image.
Pixelate
pixelate
: Applies a pixelation effect.
Tint
tint
: Blends an image with one or more tint colors.
Chaining Multiple Effects
effects
: An array of objects the configure the effects to apply to an image.
More Filters & Effects
Learn about what other filters and effects are supported on CldImage Configuration.
Image Overlays
Image overlays allow you to place one or multiple images on top of another image.
Overlay Image by Public ID
overlays
: Any array of overlay objects
Overlay Image with Blend Mode
appliedEffects
: When configured on an overlay object, allows you to set an effect
that applies a blend mode, such as “multiply”
Image Underlays
Image underlays allow you to place one or multiple images behind a base image.
Replace Background with Image
underlay
: Public ID of image to use under base image
Replace Background with Multiple Images
underlays
: Array of underlay objects
Text Overlays
Text overlays allow you to place text on top of an image.
Adding Text
text
: Adds text to an image with default settings
Adding Custom Text
overlays
: Uses overlay objects to add text on top of an image.
Adding Text with Effects
effects
: Applies effects to the overlaid text.