Upload

Create image from text

POST
/v1_1/{cloud_name}/{resource_type}/text

Dynamically generates an image from a specified text string.

Authorization

AuthorizationBasic <token>

Basic authentication using Cloudinary API Key and API Secret.

In: header

Path Parameters

cloud_name*string

The cloud name of your product environment.

resource_type*"image"

The type of resource to create. Must be "image" for text generation.

Value in

  • "image"

Request Body

application/json

The text content and styling parameters for image generation.

text*string

The text string to generate an image for.

public_id?string

The identifier that is used for accessing the generated image. If not specified, a unique identifier is generated.

font_family?string

The name of the font family.

font_size?integer

Font size in points.

Default12
font_color?string

Name or RGB representation of the font's color (e.g., red or

Default"black"
text_align?string

Text alignment.

Value in

  • "left"
  • "center"
  • "right"
  • "justify"
font_weight?string

Whether to use a normal or bold font.

Default"normal"

Value in

  • "normal"
  • "bold"
font_style?string

Whether to use a normal or italic font.

Default"normal"

Value in

  • "normal"
  • "italic"
background?string

Name or RGB representation of the background color (e.g., red or

Default"transparent"
opacity?integer

Text opacity value between 0 (invisible) and 100.

Range0 <= value <= 100
Default100
text_decoration?string

Text decoration style.

Default"none"

Value in

  • "none"
  • "underline"
line_spacing?integer

The spacing between lines of text in pixels.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1_1/my_cloud/image/text" \  -H "Content-Type: application/json" \  -d '{    "text": "string"  }'
{  "asset_id": "string",  "public_id": "string",  "version": 0,  "version_id": "string",  "signature": "string",  "width": 0,  "height": 0,  "format": "string",  "resource_type": "string",  "created_at": "2019-08-24T14:15:22Z",  "tags": [    "string"  ],  "pages": 0,  "bytes": 0,  "type": "string",  "etag": "string",  "placeholder": true,  "url": "string",  "secure_url": "string",  "display_name": "string",  "access_control": [    {      "access_type": "token",      "key": "string",      "start": "string",      "end": "string"    }  ],  "regions": [    {}  ],  "moderation": {},  "info": {}}