Transforming an image to a rounded version is simply done by using the radius
parameter (r
in URLs). It accepts the number of pixels of the radius of all four corners.
Many website designs call for images with rounded corners, while some websites require images with a complete circular or oval (ellipse) crop. Twitter, for example, uses rounded corners for its users' profile pictures. Having images with rounded corners is great if you want to simplify your CSS and markup or when you need to support older browsers. With Cloudinary, rounding the corners of the image can be easily done on-the-fly in the cloud.
Here's an original sample image:
Here's the same image with rounded corners of 30 pixels.
Note that the conversion to PNG is needed for supporting a transparent background:
Any other radius value is accepted of course, for example - '20':
You can apply rounded corners on any image, for example, here's how to round the corners of a Facebook Profile pictures fetched in real-time:
Cloudinary supports cropping images to a shape of an ellipse or a circle by passing max
as the value of the radius
parameter (r_max
in URLs).
The following example transforms an uploaded JPG to a 100x150 PNG with max radius cropping, which generates the ellipse shape based on the detected face, with a transparent background:
Setting the width
and height
to the same value will generate a circle:
Any further image transformations can be also applied.