trait ImageSpecificTransformationTrait

Trait ImageSpecificTransformationTrait

Methods

sanitize()

Instruct Cloudinary to run a sanitizer on the image (relevant only for the SVG format).

delay(Delay|int $delay)

Sets the delay between frames of an animated image in milliseconds.

defaultImage(string $defaultImage)

Default images can be used in the case that a requested image does not exist.

density(int|string $density)

Controls the density to use when delivering an image or when converting a vector file such as a PDF or EPS document to a web image delivery format.

prefix(Prefix|string $prefix)

Prevents style class names collisions for sprite generation.

extract(PageQualifier|string|int ...$pages)

Extracts selected pages/frames from the asset.

psdTools(PageQualifier|string|int ...$pages)

Extracts selected layers/embedded objects from the PSD file.

overlay(string $layer, Position|AbsolutePosition $position = null, string $blendMode = null)

Adds an overlay over the base image.

underlay(string $layer, Position|AbsolutePosition $position = null, string $blendMode = null)

Adds an underlay under the base image.

reshape(ReshapeQualifier|EffectAction|EffectQualifier|mixed $reshape)

Changes the shape of the image.

roundCorners(int|string|CornerRadius $radiusOrTopLeft, int $topRight = null, int $bottomRight = null, int $bottomLeft = null)

Rounds the specified corners of an image.

border(Border $border)

Adds a border around the image.

backgroundColor(Background|ColorValue|string $color)

Sets the color of the background.

background(Background|string $background)

Sets the image background.

colorSpace(ColorSpace|string $colorSpace)

Controls the color space used for the delivered image.

animated(AnimatedEdit $animated)

Applies animated image transformation action.

Details

ImageTransformationFlagTrait sanitize()

Instruct Cloudinary to run a sanitizer on the image (relevant only for the SVG format).

ImageQualifierTransformationTrait delay(Delay|int $delay)

Sets the delay between frames of an animated image in milliseconds.

Parameters

Name Type Description
$delay Delay|int

Return Value

ImageQualifierTransformationTrait

$this defaultImage(string $defaultImage)

Default images can be used in the case that a requested image does not exist.

Parameters

Name Type Description
$defaultImage string Default image public ID

Return Value

$this

Density density(int|string $density)

Controls the density to use when delivering an image or when converting a vector file such as a PDF or EPS document to a web image delivery format.

Parameters

Name Type Description
$density int|string The density in dpi.

Return Value

Density

ImageSpecificTransformationTrait prefix(Prefix|string $prefix)

Prevents style class names collisions for sprite generation.

Parameters

Name Type Description
$prefix Prefix|string The style class name prefix.

Return Value

ImageSpecificTransformationTrait

LayeredImageTransformationTrait extract(PageQualifier|string|int ...$pages)

Extracts selected pages/frames from the asset.

Parameters

Name Type Description
...$pages PageQualifier|string|int

Return Value

LayeredImageTransformationTrait

See also

https://cloudinary.com/documentation/paged_and_layered_media#deliver_a_pdf_or_selected_pages_of_a_pdf

LayeredImageTransformationTrait psdTools(PageQualifier|string|int ...$pages)

Extracts selected layers/embedded objects from the PSD file.

Parameters

Name Type Description
...$pages PageQualifier|string|int

Return Value

LayeredImageTransformationTrait

See also

https://cloudinary.com/documentation/paged_and_layered_media#deliver_a_pdf_or_selected_pages_of_a_pdf

ImageSpecificTransformationTrait overlay(string $layer, Position|AbsolutePosition $position = null, string $blendMode = null)

Adds an overlay over the base image.

Parameters

Name Type Description
$layer string The public ID of the image to overlay.
$position Position|AbsolutePosition The position of the overlay with respect to the base image.
$blendMode string The blend mode. Use the constants defined in the BlendMode class.

Return Value

ImageSpecificTransformationTrait

See also

ImageOverlay
BlendMode

ImageSpecificTransformationTrait underlay(string $layer, Position|AbsolutePosition $position = null, string $blendMode = null)

Adds an underlay under the base image.

Parameters

Name Type Description
$layer string The public ID of the image to underlay.
$position Position|AbsolutePosition The position of the underlay with respect to the base image.
$blendMode string The blend mode. Use the constants defined in the BlendMode class.

Return Value

ImageSpecificTransformationTrait

See also

OverlayOverlay
BlendMode

ImageSpecificTransformationTrait reshape(ReshapeQualifier|EffectAction|EffectQualifier|mixed $reshape)

Changes the shape of the image.

Parameters

Name Type Description
$reshape ReshapeQualifier|EffectAction|EffectQualifier|mixed The reshape to apply.

Return Value

ImageSpecificTransformationTrait

ImageSpecificTransformationTrait roundCorners(int|string|CornerRadius $radiusOrTopLeft, int $topRight = null, int $bottomRight = null, int $bottomLeft = null)

Rounds the specified corners of an image.

Only $radiusOrTopLeft specified: All four corners are rounded equally according to the value.
Only $radiusOrTopLeft and $topRight specified: Round the top-left & bottom-right corners according to $radiusOrTopLeft, round the top-right & bottom-left corners according to $topRight.
Only $radiusOrTopLeft, $topRight and $bottomRight specified: Round the top-left corner according to $radiusOrTopLeft, round the top-right & bottom-left corners according to $topRight, round the bottom-right corner according to $bottomRight.
All qualifiers specified: Each corner is rounded accordingly.

Parameters

Name Type Description
$radiusOrTopLeft int|string|CornerRadius The radius in pixels of the top left corner or all the corners if no other corners are specified.
$topRight int The radius in pixels of the top right corner.
$bottomRight int The radius in pixels of the bottom right corner.
$bottomLeft int The radius in pixels of the bottom left corner.

Return Value

ImageSpecificTransformationTrait

See also

RoundCorners

ImageSpecificTransformationTrait border(Border $border)

Adds a border around the image.

Parameters

Name Type Description
$border Border A Border object in which you set the width, style and color of the border. See the Border class.

Return Value

ImageSpecificTransformationTrait

See also

Border

ImageSpecificTransformationTrait backgroundColor(Background|ColorValue|string $color)

Sets the color of the background.

Parameters

Name Type Description
$color Background|ColorValue|string The color of the background to set.

Return Value

ImageSpecificTransformationTrait

See also

Background

ImageSpecificTransformationTrait background(Background|string $background)

Sets the image background.

Parameters

Name Type Description
$background Background|string The background to set.

Return Value

ImageSpecificTransformationTrait

See also

Background

ImageSpecificTransformationTrait colorSpace(ColorSpace|string $colorSpace)

Controls the color space used for the delivered image.

Parameters

Name Type Description
$colorSpace ColorSpace|string Use the constants defined in the ColorSpace class.

Return Value

ImageSpecificTransformationTrait

See also

ColorSpace

ImageSpecificTransformationTrait animated(AnimatedEdit $animated)

Applies animated image transformation action.

Parameters

Name Type Description
$animated AnimatedEdit Animated image action.

Return Value

ImageSpecificTransformationTrait