Round Corner
Adds rounded corners to the image with a specified background color.
How to use
The round_corner transformation allows you to add rounded corners to an image with a specified background color.
Pass the following query params to the API endpoint:
round_corner=rx[,ry][,color]
Where:
rx
is the horizontal radius in pixels (required)ry
is the vertical radius in pixels (optional, defaults torx
if not provided)color
is the background color (optional)
For example: round_corner=20,30,ff0000
Parameters
rx
: The horizontal radius in pixels. This parameter is required.ry
: The vertical radius in pixels. This parameter is optional. If not provided, it will be set equal torx
.color
: The background color for the rounded corners. This parameter is optional. It can be specified as:- A color name (e.g., “red”, “blue”, “green”)
- A hexadecimal RGB value without the ”#” character (e.g., “ff0000” for red)
Effect of Round Corner
- Applies rounded corners to the image using the specified radii.
- Fills the corner areas outside the rounded shape with the specified background color.
- If no background color is specified, it defaults to a transparent background (for formats that support transparency).
This transformation can be used to soften the edges of images or create a more visually appealing shape for thumbnails or profile pictures.
Original Image
URL : https://www.thunderimage.com/sample/yosemite.jpg
Image with rounded corners
URL: /transform?url=https://www.thunderimage.com/sample/yosemite.jpg&round_corner=50,50,ff5437
Best Practices
- Use smaller radius values for subtle rounding effects and larger values for more pronounced corners.
- When specifying only one radius value, the corners will be perfectly rounded (equal x and y radii).
- Choose a background color that complements your image or matches the background of the page where the image will be displayed.
- Remember that applying rounded corners may crop out some content at the edges of the image, so adjust your composition accordingly.
- For transparent backgrounds, ensure you’re using an image format that supports transparency (e.g., PNG or WebP).
Authorizations
API key required for authentication
Query Parameters
The URL of the image to be transformed.
Adds rounded corners to the image. Format: rx[,ry][,color] where rx and ry are pixel values for the radii, and color is an optional background color.
Response
The transformed image in JPEG format.