Write Text On Image

This function block allows you to overlay custom text onto images. Use its controls to choose text content, position, font, size and color. The block produces a new image with the text rendered on top, suitable for visualization or saving.

πŸ“₯ Inputs

Image Any Main image to place text on.

String Text to write on the image. If not connected, the block will write an empty string.

πŸ“€ Outputs

Image Image result with the written text overlaid.

πŸ•ΉοΈ Controls

Text Position Horizontal Set horizontal anchor for the text. Values usually range from 0.0 (left) to 1.0 (right).

Text Position Vertical Set vertical anchor for the text. Values usually range from 0.0 (top) to 1.0 (bottom).

Font Scale Adjust overall text size. The block uses image dimensions to scale text proportionally.

Font Thickness Set the stroke thickness of the text to improve readability.

Font Selector Choose the font style for the text.

Color Selector Pick the text color. Use contrasting colors for better visibility.

🎨 Features

  • Responsive font scaling: text size adapts to image dimensions so annotations remain readable on different resolutions.

  • Precise placement: horizontal and vertical position sliders let you place text anywhere on the image.

  • Readability controls: font thickness and color choices help ensure the text stands out over variable backgrounds.

  • Works with live or static images: suitable for camera frames, loaded images or processed outputs.

βš™οΈ Running mechanism

When the block runs it receives the input image and the optional text input, then uses the current control settings to render the text onto a copy of the image. The result is output as Image so downstream blocks can display or save it. If no text input is connected, nothing will be added (empty text).

πŸ“ Usage suggestions

  • Feed your image into Image Any and connect a text source to String (for example String Input or a block that outputs text).

  • Adjust Text Position Horizontal and Text Position Vertical to place the label where it doesn’t occlude important image content.

  • Use Font Scale and Font Thickness to make text readable at the target output size.

  • Choose a color with Color Selector that contrasts with the image background.

πŸ’‘ Tips and Tricks

  • Combine with Date-Time or Date-Time List to add timestamps to frames for logging or debugging.

  • Use String Input to provide custom labels interactively.

  • Feed results to Show Image to preview annotations in real time.

  • Save annotated images using Image Write or batch them with Image Logger for later review.

  • If you need consistent text size across different resolutions, add an Image Resizer before this block so the input resolution is known and stable.

  • Overlay recognition results by connecting an OCR block such as OCR (EasyOCR) or OCR output text into the String input to label detected text.

  • For region-specific annotations, crop with Image ROI Select first, then write text on the cropped area and merge back if needed.

  • When annotating detection results, combine with detection blocks (for example Object Detection, Object Detection - Custom) and use detected positions to place labels near objects.

πŸ› οΈ Troubleshooting

  • Text too small or too large: increase or decrease Font Scale and consider inserting an Image Resizer upstream.

  • Text hard to read on busy backgrounds: increase Font Thickness or pick a contrasting color with the Color Selector. Adding a semi-transparent background or drawing a filled rectangle before writing text (using other draw blocks) can help.

  • Nothing appears: ensure the Image Any input actually provides image data and the String input is connected (or enter text via String Input). The block will output the original image if the text is empty.

Last updated

Was this helpful?