Programmable Media

Create images from text

Last updated: Jun-25-2024

You can use Cloudinary to dynamically generate an image from a given textual string using the text method of the Upload API. For example, to create an image from the text string "Hello World":

Note
Cloudinary supports dynamic text overlays without predefining text images. See the documentation on Adding text captions and the blog post on How to overlay text on image easily, pixel perfect and with no CSS/HTML for more details.

Optional parameters

You can also optionally include various font, color and style parameters that can be specified to customize the look & feel of the text based image. For a full listing of the possible optional parameters available for the text method, see the Upload API reference.

For example, to create an image of the text string "Sample Name" in 12 point, black, Arial font with 90% opacity, and the public ID of "dark_name":

The resulting image will also include all the styling information stored as metadata, which means the resulting image can be referred to as a "text style" base for creating text overlays on the fly. See the documentation on Text style images for more information.

Response

The API call returns a JSON response including the URLs for accessing the generated image through a CDN, the assigned public ID and the current version of the resource.

For example:

✔️ Feedback sent!

Rate this page: