trait MiscEffectTrait

Trait MiscEffectTrait

Methods

artisticFilter(string $filter)

Applies the selected artistic filter to the image.

cartoonify(float $lineStrength = null, float|string $colorReduction = null)

Applies a cartoon effect to an image.

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.

oilPaint(int $strength = null)

Applies an oil painting effect to the image.

redEye()

Removes red eyes in the image.

advancedRedEye()

Removes red eyes with the Advanced Facial Attribute Detection add-on.

vectorize(int $colors = null, float $detail = null, float $despeckle = null, int $corners = null, int $paths = null)

Vectorizes the image.

outline(string $mode = null, int $width = null, int $blurLevel = null)

Adds an outline to a transparent image.

shadow(int $strength = null, PointValue $position = null, string $color = null)

Adds a shadow to the image.

dropShadow(int $azimuth = null, int $elevation = null, int $spread = null)

Adds a natural looking shadow to an image.

Details

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.

Parameters

Name Type Description
$filter string The filter to apply. Use the constants defined in the ArtisticFilter class.

Return Value

mixed

See also

ArtisticFilter
https://cloudinary.com/documentation/image_transformations#available_filters

static Cartoonify cartoonify(float $lineStrength = null, float|string $colorReduction = null)

Applies a cartoon effect to an image.

Parameters

Name Type Description
$lineStrength float The thickness of the lines. (Range: 0 to 100, Server default: 50)
$colorReduction float|string The decrease in the number of colors and corresponding saturation boost of the remaining colors. (Range: 0 to 100, Server default: automatically adjusts according to the line_strength value). Higher reduction values result in a less realistic look. Set $colorReduction to Cartoonify::BLACK_WHITE for a black and white cartoon effect.

Return Value

Cartoonify

See also

Cartoonify

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.

Parameters

Name Type Description
$source string The public ID of the source artwork.
$strength int The strength of the style transfer. Higher numbers result in an output that is more highly influenced by the source artwork style. (Range: 0 to 100, Server default: 100)
$preserveColor bool When true, style elements of the source artwork, such as brush style and texture, are transferred to the target photo, but the prominent colors from the source artwork are not transferred, so the result retains the original colors of the target photo.

Return Value

EffectAction

See also

https://cloudinary.com/documentation/neural_artwork_style_transfer_addon

static StrengthEffectAction oilPaint(int $strength = null)

Applies an oil painting effect to the image.

Parameters

Name Type Description
$strength int The strength of the effect. (Range: 0 to 100, Server default: 30)

Return Value

StrengthEffectAction

static EffectAction redEye()

Removes red eyes in the image.

Return Value

EffectAction

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.

Parameters

Name Type Description
$colors int The number of colors. (Range: 2 to 30, Server default: 10)
$detail float The level of detail. Specify either a percentage of the original image (Range: 0.0 to 1.0) or an absolute number of pixels (Range: 0 to 1000). (Server default: 300)
$despeckle float The size of speckles to suppress. Specify either a percentage of the original image (Range: 0.0 to 1.0) or an absolute number of pixels (Range: 0 to 100, Server default: 2)
$corners int The corner threshold. Specify 100 for no smoothing (polygon corners), 0 for completely smooth corners. (Range: 0 to 100, Default: 25)
$paths int The optimization value. Specify 100 for least optimization and the largest file. (Range: 0 to 100, Server default: 100).

Return Value

Vectorize

See also

Vectorize

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.

Parameters

Name Type Description
$mode string The type of outline effect. Use the constants defined in the Outline class. (Default: OutlineMode::INNER and OutlineMode::OUTER).
$width int The thickness of the outline in pixels. (Range: 1 to 100, Server default: 5)
$blurLevel int The level of blur of the outline. (Range: 0 to 2000, Server default: 0)

Return Value

Outline

See also

Outline
OutlineMode
https://cloudinary.com/documentation/image_transformations#outline_effects

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.

Parameters

Name Type Description
$strength int The strength of the shadow. (Range: 0 to 100, Server default: 40)
$position PointValue The position of the shadow. (Server default: bottom right)
$color string The color of the shadow (Server default: gray)

Return Value

Shadow

See also

Shadow

static DropShadow dropShadow(int $azimuth = null, int $elevation = null, int $spread = null)

Adds a natural looking shadow to an image.

Parameters

Name Type Description
$azimuth int Value in range 0 - 360 (degrees).
$elevation int Value in range 0 - 90 (degrees).
$spread int Value in range 0 -100.

Return Value

DropShadow

See also

DropShadow