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. By default, txt renders on a single line, clipped or scaled to fit its bounds (see txt-fit). Set txt-fit=wrap or txt-fit=wrapmax to render multiple lines directly within txt, including explicit line breaks. For complex, pre-composited typesetting, the ~text endpoint is still available.
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
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=SEVMTE8gV09STEQh&txt-size=62&txt-color=ff2e4357&txt-align=middle,center&txt-font64=RnV0dXJhIENvbmRlbnNlZCBNZWRpdW0
Multiple Text Layers
txt supports up to 20 simultaneous text layers. The bare txt parameter is layer 0; additional layers use the [N] index syntax, where N is 1–19.
https://assets.imgix.net/photo.jpg?w=800
&txt-color=fff&txt-size=40
&txt=Breaking%20News&txt-align=top,center
&txt[1]=Live%20from%20Brooklyn&txt-align[1]=bottom,left&txt-color[1]=ff0000&txt-size[1]=24Every bare txt-* style parameter (font, size, color, align, padding, shadow, width, fit, and even txt-x/txt-y) applies to every text layer by default. An indexed spelling — txt-color[1], txt-size[2] — overrides that style for one layer only. The text content itself never inherits: only txt[N] creates layer N. Layers are sparse-friendly — txt[1] and txt[3] with no txt[2] draws two layers, both still styled by the bare base.
An invalid indexed override doesn’t fall back to the bare value — txt-size=40&txt-size[1]=abc gives layer 1 the default size, not 40. A layer that spells a parameter owns it.
Each layer is laid out against the whole canvas independently — layers don’t flow around each other, so give each its own txt-align or txt-x/txt-y to avoid overlap.
Indexing accepts any alias (t[1] for txt[1]), and the Base64 twin goes before the bracket: txt64[1], not txt[1]64. An index past the cap (txt[20]) or a malformed one (txt[a]) is silently ignored.
URL Signing
Sign exactly the bytes you send — txt[1] and txt%5B1%5D are different URLs with different signatures.
Parameter priority
When using multiple parameters to overlay images, parameter priority will dictate which parameter is shown over another. The order is as follows:
textmarkblend
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. This applies per full layer stack: every text layer draws above every watermark layer, which draws above every blend layer, with layers within each family stacking bottom-to-top in index order (see Multiple Watermarks and Multiple Blends).







