How to add bold in Edit Image node

Hey guys,

I want to add bold to a part of the text that the AI ​​will generate for me. Since this bold part is random, I would like to make it with some variable. Is that possible?

Example:

Example text < bold >from the n8n forum </ bold > published today.

Hello
I hope you are well.

Do you already have the logic set up inside the AI ​​Agent?

Because you can try putting the expression between asterisks

**{{ $json.nameVariavel }}**

Suggestion, then test in a separate flow to validate the suggestion ok

I hope I helped in some way.

If this suggestion solved your problem, mark my post as a solution (blue box with check mark) so that this ongoing discussion does not distract others who want to find out the answer to the original question and press the heart :heart:button. Thanks :+1:

The Edit Image node uses the GraphicsMagick / gm node module to modify an image. As far as I know, that doesn’t support any kind of markup / formatting within the text string, including markdown syntax, e.g. surrounding the text with markdown ** asterisks for bold, most likely WON’T WORK.

Each time the Edit Image node runs, it applies one fixed string all in the same font/size.

So, you’ll probably have to split up your string and apply it to the image in at least 2 Edit Image steps.

The Edit Image node also doesn’t have a “bold” option so you might be able to simulate that by applying the “bold” part in a slightly larger font size.

Positioning the non-“bold” part after the randomly generated “bold” part will be tricky too. If it’s possible to put them on “separate lines” (i.e. different y-offsets), that might be easier.

Here’s a rough start for what might eventually get you what you want.

Please DO NOT mark a response to your question as the solution UNLESS it actually helped you solve your issue.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.