trait ImageEffectTrait

Trait ImageEffectTrait

Methods

blackWhite(int|null $threshold = null)

Converts the image to black and white.

colorize(int|null $level = null, string|null $color = null)

Colorizes the image.

grayscale()

Converts the image to gray-scale (multiple shades of gray).

negate()

Negates the image colors (negative).

sepia(int|null $level = null)

Changes the color scheme of the image to sepia.

assistColorBlind(int|null $strength = null)

Applies stripes to the image to help people with common color-blind conditions to differentiate between colors that are similar for them.

simulateColorBlind(string|null $condition = null)

Simulates the way an image would appear to someone with the specified color-blind condition.

lightroom()

Applies Adobe Lightroom filter.

theme(string $color, int|null $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).

Details

static ThresholdEffectAction blackWhite(int|null $threshold = null)

Converts the image to black and white.

Parameters

Name Type Description
$threshold int|null The balance between black (100) and white (0). (Range: 0 to 100, Server default: 50)

Return Value

ThresholdEffectAction

static Colorize colorize(int|null $level = null, string|null $color = null)

Colorizes the image.

Parameters

Name Type Description
$level int|null The strength of the color. (Range: 0 to 100, Server default: 100)
$color string|null The color to use for colorization. Specify HTML name or RGB hex code. (Server default: gray)

Return Value

Colorize

static EffectAction grayscale()

Converts the image to gray-scale (multiple shades of gray).

Return Value

EffectAction

static EffectAction negate()

Negates the image colors (negative).

Return Value

EffectAction

static LevelEffectAction sepia(int|null $level = null)

Changes the color scheme of the image to sepia.

Parameters

Name Type Description
$level int|null The level of sepia to apply. (Range: 1 to 100, Server default: 80)

Return Value

LevelEffectAction

static AssistColorBlind assistColorBlind(int|null $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.

Parameters

Name Type Description
$strength int|null The strength of the stripes. (Range: 1 to 100, Server default: 10)

Return Value

AssistColorBlind

See also

AssistColorBlind

static SimulateColorBlind simulateColorBlind(string|null $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.

Parameters

Name Type Description
$condition string|null The color-blind condition. Use the constants defined in the SimulateColorBlind class.

Return Value

SimulateColorBlind

See also

SimulateColorBlind

static LightroomEffect lightroom()

Applies Adobe Lightroom filter.

Return Value

LightroomEffect

static ThemeEffect theme(string $color, int|null $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).

Parameters

Name Type Description
$color string The target background color. Specify either the name of a color (e.g. black, lightgray), or an RGB hex value (e.g. f0ebe6).
$photoSensitivity int|null The sensitivity to photographic elements of an image. A value of 0 treats the whole image as non-photographic. A value of 200 treats the whole image as photographic, so no theme change is applied. Range: 0 to 200. Default: 100.

Return Value

ThemeEffect

See also

ThemeEffect
ThemeQualifier