ImageEffect
abstract class ImageEffect
Defines effects that you can apply to transform your images.
Learn more: Image effects
Methods
Applies a blurring filter to the asset.
Applies a blurring filter to the faces detected on the asset.
Applies a blurring filter to the region on the asset.
Applies a vignette effect.
Converts the image to black and white.
Colorizes the image.
Converts the image to gray-scale (multiple shades of gray).
Negates the image colors (negative).
Changes the color scheme of the image to sepia.
Applies stripes to the image to help people with common color-blind conditions to differentiate between colors that are similar for them.
Simulates the way an image would appear to someone with the specified color blind condition.
Applies a pixelation effect to the image.
Makes the background of the image transparent (or solid white for formats that do not support transparency).
Makes the background of an image transparent (or solid white for JPGs).
Uses the Cloudinary AI Background Removal add-on to make the background of an image transparent.
Applies an ordered dither filter to the image.
Applies a gradient fade effect from the top edge of the image.
Trims pixels according to the transparency levels of a specified overlay image.
Applies the selected artistic filter to the image.
Applies a cartoon effect to an image.
Transfers the style of a source artwork to a target photograph using the Neural Artwork Style Transfer add-on.
Applies an oil painting effect to the image.
Removes red eyes in the image.
Removes red eyes with the Advanced Facial Attribute Detection add-on.
Vectorizes the image.
Adds an outline to a transparent image.
Adds a shadow to the image.
Adds a natural looking shadow to an image.
Applies Adobe Lightroom filter.
Changes the main background color to the one specified, as if a 'theme change' was applied (e.g. dark mode vs light mode).
Applies a generative restore effect to the asset.
Applies a generative recolor effect to the asset.
Applies a generative remove effect to the asset.
Applies a generative replacement effect to the asset.
Uses AI-based prediction to add fine detail while upscaling small images.
Details
static Blur
blur(int $strength = null)
Applies a blurring filter to the asset.
static Blur
blurFaces(int $strength = null)
Applies a blurring filter to the faces detected on the asset.
static Blur
blurRegion(int|string $strength = null, int|string $x = null, int|string $y = null, int|string $width = null, int|string $height = null)
Applies a blurring filter to the region on the asset.
static StrengthEffectAction
vignette(int $strength = null)
Applies a vignette effect.
static ThresholdEffectAction
blackWhite(int $threshold = null)
Converts the image to black and white.
static Colorize
colorize(int $level = null, string $color = null)
Colorizes the image.
static EffectAction
grayscale()
Converts the image to gray-scale (multiple shades of gray).
static EffectAction
negate()
Negates the image colors (negative).
static LevelEffectAction
sepia(int $level = null)
Changes the color scheme of the image to sepia.
static AssistColorBlind
assistColorBlind(int $strength = null)
Applies stripes to the image to help people with common color-blind conditions to differentiate between colors that are similar for them.
You can replace colors using the xRay() method of the \Cloudinary\Transformation\AssistColorBlind class.
static SimulateColorBlind
simulateColorBlind(string $condition = null)
Simulates the way an image would appear to someone with the specified color blind condition.
For a list of supported color blind conditions see the \Cloudinary\Transformation\SimulateColorBlind class.
static Pixelate
pixelate(int $squareSize = null)
Applies a pixelation effect to the image.
static MakeTransparent
makeTransparent(int $tolerance = null)
Makes the background of the image transparent (or solid white for formats that do not support transparency).
The background is determined as all pixels that resemble the pixels on the edges of the image.
static RemoveBackground
removeBackground(bool $screen = false, string|Color $colorToRemove = null)
Makes the background of an image transparent (or solid white for JPGs).
Use when the background is a uniform color.
static BackgroundRemoval
backgroundRemoval(bool|null $fineEdges = null, array $hints = [])
Uses the Cloudinary AI Background Removal add-on to make the background of an image transparent.
static Dither
dither(int $level = null)
Applies an ordered dither filter to the image.
Use the constants defined in \Cloudinary\Transformation\OrderedDither for $level.
static GradientFade
gradientFade(int $strength = null, string $type = null)
Applies a gradient fade effect from the top edge of the image.
You can specify other edges using the x and y methods of the \Cloudinary\Transformation\GradientFade class.
static CutOut
cutOut(string|Media $source = null)
Trims pixels according to the transparency levels of a specified overlay image.
Wherever an overlay image is transparent, the original is shown, and wherever an overlay is opaque, the resulting image is transparent.
static mixed
artisticFilter(string $filter)
Applies the selected artistic filter to the image.
See the Image Transformations guide for examples of each of the filters.
static Cartoonify
cartoonify(float $lineStrength = null, float|string $colorReduction = null)
Applies a cartoon effect to an image.
static EffectAction
styleTransfer(string $source, int $strength = null, bool $preserveColor = null)
Transfers the style of a source artwork to a target photograph using the Neural Artwork Style Transfer add-on.
For details, see the Neural Artwork Style Transfer add-on documentation.
static StrengthEffectAction
oilPaint(int $strength = null)
Applies an oil painting effect to the image.
static EffectAction
redEye()
Removes red eyes in the image.
static EffectAction
advancedRedEye()
Removes red eyes with the Advanced Facial Attribute Detection add-on.
For details, see the Advanced Facial Attribute Detection add-on documentation.
static Vectorize
vectorize(int $colors = null, float $detail = null, float $despeckle = null, int $corners = null, int $paths = null)
Vectorizes the image.
Use the methods in \Cloudinary\Transformation\Vectorize to control different aspects of the vectorize effect.
Notes: * To deliver the image as a vector image, make sure to change the format (or URL extension) to a vector format, such as SVG. However, you can also deliver in a raster format if you just want to get the 'vectorized' graphic effect. * Large images are scaled down to 1000 pixels in the largest dimension before vectorization.
static Outline
outline(string $mode = null, int $width = null, int $blurLevel = null)
Adds an outline to a transparent image.
For examples, see the Image Transformations guide.
static Shadow
shadow(int $strength = null, PointValue $position = null, string $color = null)
Adds a shadow to the image.
The shadow is offset by the x and y values specified in the $position qualifier.
static DropShadow
dropShadow(int $azimuth = null, int $elevation = null, int $spread = null)
Adds a natural looking shadow to an image.
static LightroomEffect
lightroom()
Applies Adobe Lightroom filter.
static ThemeEffect
theme(string $color, integer $photoSensitivity = null)
Changes the main background color to the one specified, as if a 'theme change' was applied (e.g. dark mode vs light mode).
static GenerativeEffectAction
generativeRestore()
Applies a generative restore effect to the asset.
static GenerativeRecolor
generativeRecolor(string|array $prompt, string $toColor, bool $detectMultiple = null)
Applies a generative recolor effect to the asset.
static GenerativeRemove
generativeRemove(string|array $prompt = null, string|array $region = null, bool $detectMultiple = null, bool $removeShadow = null)
Applies a generative remove effect to the asset.
static GenerativeReplace
generativeReplace(string $fromPrompt, string $toPrompt, bool $preserveGeometry = null, bool $detectMultiple = null)
Applies a generative replacement effect to the asset.
static GenerativeEffectAction
upscale()
Uses AI-based prediction to add fine detail while upscaling small images.
This 'super-resolution' feature scales each dimension by four, multiplying the total number of pixels by 16.