new Transformation()

SDK

Description
  • Defines how to transform an asset

Methods


addAction( action ) → {this}

Parameters
Name Type Description
action SDK.Action | string
Returns

addTransformation( tx ) → {this}

Description

Allows the injection of a raw transformation as a string into the transformation, or a Transformation instance that was previously created

Parameters
Name Type Description
tx string | SDK.Transformation
Returns
Examples

			import {Transformation} from "@cloudinary/url-gen";
			
			const transformation = new Transformation();
			transformation.addTransformation('w_100/w_200/w_300');

toString() → {string}

Returns

animated( animatedAction ) → {this}

Description

Delivers an animated GIF.

Parameters
Name Type Description
animatedAction AnimatedAction
Returns

border( borderAction ) → {this}

Description

Adds a border around the image.

Parameters
Name Type Description
borderAction Border
Returns

reshape( reshapeAction ) → {this}

Description

Adjusts the shape of the delivered image.
Learn more: Shape changes and distortion effects

Parameters
Name Type Description
reshapeAction IReshape
Returns

resize( resizeAction ) → {this}

Description

Resize the asset using provided resize action

Parameters
Name Type Description
resizeAction ResizeSimpleAction
Returns

quality( quality ) → {this}

Description

An alias to Action Delivery.quality

Parameters
Name Type Description
quality string | number
Returns

format( format ) → {this}

Description

An alias to Action Delivery.format

Parameters
Name Type Description
format string
Returns

roundCorners( roundCornersAction ) → {this}

Description

Rounds the specified corners of an image.

Parameters
Name Type Description
roundCornersAction
Returns

overlay( overlayAction ) → {this}

Description

Adds an overlay over the base image.

Parameters
Name Type Description
overlayAction LayerAction
Returns

underlay( underlayAction ) → {this}

Description

Adds an underlay under the base image.

Parameters
Name Type Description
underlayAction LayerAction
Returns

addVariable( variableAction ) → {this}

Description

Defines an new user variable.

Parameters
Name Type Description
variableAction VariableAction
Returns

conditional( conditionAction ) → {this}

Description

Specifies a condition to be met before applying a transformation.

Parameters
Name Type Description
conditionAction ConditionalAction
Returns

effect( effectAction ) → {this}

Description

Applies a filter or an effect on an asset.

Parameters
Name Type Description
effectAction SimpleEffectAction
Returns

adjust( action ) → {this}

Description

Applies adjustment effect on an asset.

Parameters
Name Type Description
action
Returns

rotate( rotateAction ) → {this}

Description

Rotates the asset by the given angle.

Parameters
Name Type Description
rotateAction RotateAction
Returns

namedTransformation( namedTransformation ) → {this}

Description

Applies a pre-defined named transformation of the given name.

Parameters
Name Type Description
namedTransformation NamedTransformation
Returns

delivery( deliveryAction ) → {this}

Description

Applies delivery action.

Parameters
Name Type Description
deliveryAction
Returns

backgroundColor( color ) → {this}

Description

Sets the color of the background.

Parameters
Name Type Description
color Qualifiers.Color
Returns

psdTools( action ) → {this}

Description

Adds a layer in a Photoshop document.

Parameters
Name Type Description
action
Returns

extract( action ) → {this}

Description

Extracts an image or a page using an index, a range, or a name from a layered media asset.

Parameters
Name Type Description
action
Returns

addFlag( flagQualifier ) → {this}

Description

Adds a flag as a separate action.

Parameters
Name Type Description
flagQualifier Qualifiers.Flag | string
Returns

customFunction() → {this}

Description

Inject a custom function into the image transformation pipeline.

Returns

transcode( action ) → {this}

Description

Transcodes the video (or audio) to another format.

Parameters
Name Type Description
action Action
Returns

videoEdit( action ) → {this}

Description

Applies the specified video edit action.

Parameters
Name Type Description
action videoEditType
Returns