Text Overlay

These parameters are used when you want to overlay text over an image.

text

This parameter takes UTF-8 text strings as input. If this parameter is omitted, none of the other text related parameters will work.

If you want to write multiple lines, you can pass the \n character. For example, you can do text=simple\ntext.

text=example
original image
text=example
text=example
original image
original image

text_top

This parameter specifies position of text in an image. It's given as number of pixel from top edge of image. Default value for this parameter is 0.

text_left

This parameter specifies position of text in an image. It's given as number of pixel from left edge of image. Default value for this parameter is 0.

text_font

This parameter specifies font-face to use while writing text over image. Default font is is sans-serif but you can specify any web-safe fonts to use here.

text_font_size

This parameter specifies font-size of the fonts to use in pixels. Default value is 48px.

text_line_height

This parameter specifies line height to use in pixels. Default value is 0 pixels.

text_align

Decides alignment of the text. Valid values are left, right and center. Default value is center.

text_color

You can provide any web-safe color name or a hex coded color name like '#2d2d2d'. Default value is black.

text_bg_color

This parameter can change background of the text. Default value is transparent.

text=text_bg_color
original image
text=text_bg_color
text_bg_color=%232d2d2d&text_color=white
original image
original image

text_padding

If you have specified text_bg_color other than transparent, this parameter will be able to put padding around text. Default value is 0 pixels.

text_position

Decides position of text on an image. Valid values are topleft, top, topright, right, bottomright, bottom, bottomleft, left and center.

text_rotate

Rotates text about its center. The rotation angle can be any angle between 0 and 360.

text_wrap

Automatically puts text in newline if it overflows the given width. Default value is false

text_width_pct

Maximum width of text overlay as percentage of output width. This parameter can be between 0 and 1. For example if output image width is 500 pixel and if text_width_pct is 0.1, the text overlay layer will be of maximum width of 50 pixel.

text_height_pct

Maximum height of text overlay as percentage of output height. This parameter can be between 0 and 1. For example if output image height is 500 pixel and if text_height_pct is 0.1, the text overlay layer will be of maximum height of 50 pixel.