Text String txt

The text string to overlay on the image. This value must be supplied for text to be rendered—all other text parameters are ignored if it isn't set. Using the txt parameter is best for single-line text. For multi-line text, please see our ~text documentation instead.

imgix has full support for UTF-8 characters, and will appropriately render non-Latin character sets and emoji (Unicode 15.0 support). This means that you can easily pipe in localized text to a base image instead of creating a different image for each language you want to support.

The txt parameter has the following defaults if none of the other text parameters are set:

  • Position: Lower right corner
  • Font: Helvetica
  • Size: 12px
  • Color: #000 (Opaque Black)
  • Padding: 10px

txt=Hello%20World!
txt=HELLO%20WORLD!&txt-size=62&txt-color=ff2e4357&txt-align=middle,center&txt-font=Futura%20Condensed%20Medium
txt=%E4%BD%A0%E5%A5%BD&txt-size=62&txt-color=ff2e4357&txt-align=middle,center&txt-font=Futura%20Condensed%20Medium
txt=%F0%9F%98%91%F0%9F%92%A9%E2%9D%A4%EF%B8%8F%EF%B8%8F&txt-size=62&txt-color=ff2e4357&txt-align=middle,center&txt-font=Futura%20Condensed%20Medium

Using Base64 encoding

Prefer Base64 Variant

imgix recommends using the Base64 variant version of this parameter to make encoding values easier.

Using Base64 encoding can help ensure you don't run into issues when encoding text into URLs. This is especially important when doing more complex image compositions, where you pass collections of text parameters to the ~text endpoint.

txt64=SGVsbG8gV29ybGQh
txt64=SEVMTE8gV09STEQh&txt-size=62&txt-color=ff2e4357&txt-align=middle,center&txt-font64=RnV0dXJhIENvbmRlbnNlZCBNZWRpdW0
txt64=5L2g5aW9&txt-size=62&txt-color=ff2e4357&txt-align=middle,center&txt-font64=RnV0dXJhIENvbmRlbnNlZCBNZWRpdW0
txt64=8J-YkfCfkqninaTvuI_vuI8&txt-size=62&txt-color=ff2e4357&txt-align=middle,center&txt-font64=RnV0dXJhIENvbmRlbnNlZCBNZWRpdW0

Parameter Priority

When using multiple parameters to overlay images, parameter priority will dictate which parameter is shown over another. The order is as follows:

  1. text
  2. mark
  3. blend

A parameter with a higher priority will be shown over parameters of a lower priority, e.g. text will always be shown above mark, and mark above blend.

Text, mark & blend on a single image

See the API specification for more information about this parameter's value ranges and format.