trait ImageColorEffectTrait

Trait ImageColorEffectTrait

Methods

blackWhite(int $threshold = null)

Converts the image to black and white.

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

Colorizes the image.

grayscale()

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

negate()

Negates the image colors (negative).

sepia(int $level = null)

Changes the color scheme of the image to sepia.

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.

simulateColorBlind(string $condition = null)

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

Details

static ThresholdEffectAction blackWhite(int $threshold = null)

Converts the image to black and white.

Parameters

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

Return Value

ThresholdEffectAction

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

Colorizes the image.

Parameters

Name Type Description
$level int The strength of the color. (Range: 0 to 100, Server default: 100)
$color string 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 $level = null)

Changes the color scheme of the image to sepia.

Parameters

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

Return Value

LevelEffectAction

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.

Parameters

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

Return Value

AssistColorBlind

See also

AssistColorBlind

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.

Parameters

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

Return Value

SimulateColorBlind

See also

SimulateColorBlind