cloudinary-labs/cloudinary-laravel
Laravel integration for Cloudinary: upload, manage, and transform images and videos with an easy Facade/API, configurable storage, and URL generation. Supports signed delivery, eager transformations, and seamless use in apps and queues.
title: Examples of using Cloudinary Laravel. description: Examples of using Cloudinary Laravel. ogImageTitle: Examples head:
import { CldImage } from "astro-cloudinary";
import CodeBlock from '@components/CodeBlock.astro'; import HeaderImage from '@components/HeaderImage.astro';
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.
Remove Background
removeBackground: Removes the background of the image using AI
:::tip The Cloudinary AI Background Removal add-on is required to use this feature. :::
Color Background
background: Specifies a color to use as a background.
Image Background
underlay: Specifies a public ID to use as an underlaying image.
:::tip The Generative AI Background Replace feature can use AI to replace the background with an image based on a prompt, potentially resulting in better results! :::
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.
Learn more about cropping and responsive images.
fillBackground: Fills the background of an image using Generative AI
:::tip The generative fill transformation is currently in Beta. Learn more. :::
recolor: Recolors an object in an image using Generative AI
:::tip The generative recolor transformation is currently in Beta. Learn more. :::
remove: Removes an object in an image using Generative AI
:::tip The generative remove transformation is currently in Beta. Learn more. :::
replace: Replaces an object in an image using Generative AI
:::tip The generative replace transformation is currently in Beta. Learn more. :::
replaceBackground: Replaces the background of an image with an AI-generated background.
:::tip The generative replace background transformation is currently in Beta. Learn more. :::
Included in the Cloudinary transformations library are different filters and effects that allow you to recolor, improve, fix, and artistically transform your images.
blur: Applies a blurring filter to an asset.
grayscale: Converts an image to grayscale (multiple shades of gray).
opacity: Controls the opacity level of an image.
pixelate: Applies a pixelation effect.
tint: Blends an image with one or more tint colors.
effects: An array of objects the configure the effects to apply to an image.
Learn about what other filters and effects are supported on CldImage Configuration.
Image overlays allow you to place one or multiple images on top of another image.
overlays: Any array of overlay objects
appliedEffects: When configured on an overlay object, allows you to set an effect
that applies a blend mode, such as "multiply"
Image underlays allow you to place one or multiple images behind a base image.
underlay: Public ID of image to use under base image
underlays: Array of underlay objects
Text overlays allow you to place text on top of an image.
overlays: Uses overlay objects to add text on top of an image.
effects: Applies effects to the overlaid text.
assetType: Specifies the type of asset to be delivered.
This is handy when wanting to create an image thumbnail from a video, where the asset type would be "video", yet delivering an image.
Find more examples on Social Card Templates.
How can I help you explore Laravel packages today?