abstract class Reshape

Adjusts the shape of the delivered image.

Learn more: Shape changes and distortion effects

Methods

distort(array ...$args)

Distorts the image to a new shape by adjusting its corners to achieve perception warping.

distortArc(float|string|mixed $degree)

Distorts the image to an arc shape.

trim(int $tolerance = null)

Removes the edges of the image based on the color of the corner pixels.

shear(float $skewX = null, float $skewY = null)

Skews the image according to the two specified values in degrees.

cutByImage(string|BaseSource $source, Position|AbsolutePosition $position = null)

Trims pixels according to the transparency levels of a given overlay image.

Details

static Distort distort(array ...$args)

Distorts the image to a new shape by adjusting its corners to achieve perception warping.

Specify four PointValue objects, representing the new coordinates for each of the image's four corners, in clockwise order from the top-left corner. For examples, see the Image Transformations guide.

Parameters

Name Type Description
...$args array The new coordinates of the image's corners.

Return Value

Distort

See also

Distort
https://cloudinary.com/documentation/image_transformations#image_shape_changes_and_distortion_effects

static EffectAction distortArc(float|string|mixed $degree)

Distorts the image to an arc shape.

For examples, see the Image Transformations guide.

Parameters

Name Type Description
$degree float|string|mixed The angle of distortion. Positive values curve the image upwards (like a frown). Negative values curve the image downwards (like a smile).

Return Value

EffectAction

See also

https://cloudinary.com/documentation/image_transformations#image_shape_changes_and_distortion_effects

static TrimEffect trim(int $tolerance = null)

Removes the edges of the image based on the color of the corner pixels.

Specify a color other than the color of the corner pixels using the colorOverride() method of the \Cloudinary\Transformation\TrimEffect class.

Parameters

Name Type Description
$tolerance int The tolerance level for color similarity. (Range: 0 to 100, Server default: 10)

Return Value

TrimEffect

See also

TrimEffect

static Shear shear(float $skewX = null, float $skewY = null)

Skews the image according to the two specified values in degrees.

Parameters

Name Type Description
$skewX float The angle of skew on the x-axis in degrees.
$skewY float The angle of skew on the y-axis in degrees.

Return Value

Shear

See also

Shear

static CutByImage cutByImage(string|BaseSource $source, Position|AbsolutePosition $position = null)

Trims pixels according to the transparency levels of a given overlay image.

Parameters

Name Type Description
$source string|BaseSource The public ID of the image overlay.
$position Position|AbsolutePosition The position of the overlay with respect to the base image.

Return Value

CutByImage

See also

CutByImage