RoundCorners

Description

Round one or more corners of an image or video.

Learn more: Rounded images Rounded videos

Examples

Round corners by a radius


			import {Cloudinary} from "@cloudinary/url-gen";
			import {byRadius, max} from "@cloudinary/url-gen/actions/roundCorners";
			
			const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
			const image = yourCldInstance.image('woman');
			// By a radius
			image.roundCorners(byRadius(10));
			// Or just the maximum possible
			image.roundCorners(max());
			image.toURL();

Classes


new RoundCornersAction()

Methods


<static> max() → {Actions.RoundCorners.RoundCornersAction}

action

Description

Generates an asset with a circular crop using the 'max' radius value.


<static> byRadius( a, b, c, d ) → {Actions.RoundCorners.RoundCornersAction}

action

Description

Rounds the specified corners of an image or a video by specifying 1-4 pixel values as follows:

  • 1 value: All four corners are rounded equally according to the specified value.
  • 2 values: 1st value => top-left & bottom-right. 2nd value => top-right & bottom-left.
  • 3 values: 1st value => top-left. 2nd value => top-right & bottom-left. 3rd value => bottom-right.
  • 4 values: Each corner specified separately, in clockwise order, starting with top-left.
Parameters
Name Type Description
a number
b number
c number
d number