Label
Adds a text label to the image.
The label
transformation adds a text label to the image. It can be positioned inside the image with specified alignment, color, and transparency.
Parameters
text
: The text label to add. Supports URL encoded text.x
: Horizontal position of the text label:- Positive number indicates position from the left, negative number from the right.
- Number followed by ‘p’ (e.g., ‘20p’) calculates the value from the image width as a percentage.
- ‘left’, ‘right’, or ‘center’ for respective alignment.
y
: Vertical position of the text label:- Positive number indicates position from the top, negative number from the bottom.
- Number followed by ‘p’ (e.g., ‘20p’) calculates the value from the image height as a percentage.
- ‘top’, ‘bottom’, or ‘center’ for respective vertical alignment.
size
: Font size of the text label.color
: Color of the text. Can be a color name or hexadecimal RGB expression without the ’#’ character.alpha
(optional): Text label transparency. A number between 0 (fully opaque) and 100 (fully transparent).font
(optional): Font type for the text label.
How to use
To add a label to an image, use the label
parameter in the API endpoint with the following format:
For example:
This would add the text “Hello” centered at the bottom of the image, with font size 24, white color, 50% transparency, using Arial font.
Original Image
URL: https://www.thunderimage.com/sample/yosemite.jpg
Image with Label
URL: /transform?url=https://www.thunderimage.com/sample/yosemite.jpg&label=Hello,center,bottom,100,white,50,Arial
Authorizations
API key required for authentication
Query Parameters
The URL of the image to be transformed.
Adds a text label to the image. Format: text,x,y,size,color[,alpha[,font]]
Response
The transformed image in its original format.