Main Content

Insert Text into Image

This example shows you how to insert colored text into an input image.

Example Model

Open the Simulink® model.

modelname = 'ex_blkInsertText.slx';
open_system(modelname)

This model reads an input image using an Image From File block with the File name parameter set to yellowlily.jpg.

The model inserts text into the input image by using an Insert Text block with these parameters:

  • Text'Yellow Lilly'

  • Color value sourceSpecify via dialog

  • Color value[255,255,0]

  • Location sourceSpecify via dialog

  • Location [x y][600,50]

  • Opacity1

  • Font faceLucidaSansDemiBold

  • Font size (points)100

Simulate the Model

Run the model. The model displays both the original input image and the output image with the inserted bold, yellow text by using Video Viewer blocks.

sim(modelname);