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 Anyand connect a text source toString(for exampleString Inputor a block that outputs text).Adjust
Text Position HorizontalandText Position Verticalto place the label where it doesnβt occlude important image content.Use
Font ScaleandFont Thicknessto make text readable at the target output size.Choose a color with
Color Selectorthat contrasts with the image background.
π‘ Tips and Tricks
Combine with
Date-TimeorDate-Time Listto add timestamps to frames for logging or debugging.Use
String Inputto provide custom labels interactively.Feed results to
Show Imageto preview annotations in real time.Save annotated images using
Image Writeor batch them withImage Loggerfor later review.If you need consistent text size across different resolutions, add an
Image Resizerbefore this block so the input resolution is known and stable.Overlay recognition results by connecting an OCR block such as
OCR (EasyOCR)orOCRoutput text into theStringinput to label detected text.For region-specific annotations, crop with
Image ROI Selectfirst, 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 Scaleand consider inserting anImage Resizerupstream.Text hard to read on busy backgrounds: increase
Font Thicknessor pick a contrasting color with theColor 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 Anyinput actually provides image data and theStringinput is connected (or enter text viaString Input). The block will output the original image if the text is empty.
Last updated
Was this helpful?