[GH-ISSUE #182] Feature request: #2307

Closed
opened 2026-03-20 21:05:25 +01:00 by sascha_hemi · 4 comments
Owner

Originally created by @nigels0 on GitHub (Dec 18, 2023).
Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/182

Is your feature request related to a problem? Please describe.
No - its an enhancement of function

Describe the solution you'd like
Really, its an enhancement to the draw function - to allow reverse image, so you can have, say white text in a red background - ideally, have an option when drawing text to say what the background is.

Originally created by @nigels0 on GitHub (Dec 18, 2023). Original GitHub issue: https://github.com/OpenEPaperLink/OpenEPaperLink/issues/182 **Is your feature request related to a problem? Please describe.** No - its an enhancement of function **Describe the solution you'd like** Really, its an enhancement to the draw function - to allow reverse image, so you can have, say white text in a red background - ideally, have an option when drawing text to say what the background is.
sascha_hemi added the enhancement label 2026-03-20 21:05:25 +01:00
Author
Owner

@nigels0 commented on GitHub (Dec 19, 2023):

Nevermind, managed to do it with the following code:

left, top, right, bottom = draw.textbbox((x,y) , args.line1, font=font)
draw.rectangle((left-2, top-5, right, bottom+5), fill = 'red')

<!-- gh-comment-id:1862977958 --> @nigels0 commented on GitHub (Dec 19, 2023): Nevermind, managed to do it with the following code: left, top, right, bottom = draw.textbbox((x,y) , args.line1, font=font) draw.rectangle((left-2, top-5, right, bottom+5), fill = 'red')
Author
Owner

@nlimper commented on GitHub (Dec 19, 2023):

I don’t know which language you are writing the code, but it’s not something within OpenEpaperLink. 😊

<!-- gh-comment-id:1862983965 --> @nlimper commented on GitHub (Dec 19, 2023): I don’t know which language you are writing the code, but it’s not something within OpenEpaperLink. 😊
Author
Owner

@nigels0 commented on GitHub (Dec 19, 2023):

Right - it is in python using the pillow library. Would be great to have a background option anyway.

<!-- gh-comment-id:1863041512 --> @nigels0 commented on GitHub (Dec 19, 2023): Right - it is in python using the pillow library. Would be great to have a background option anyway.
Author
Owner

@nlimper commented on GitHub (Dec 19, 2023):

The text is not antialiased (because the epaper only can display white/black/red without shades). So, if you use the json template, you can just draw a red box, and use white text.

<!-- gh-comment-id:1863185961 --> @nlimper commented on GitHub (Dec 19, 2023): The text is not antialiased (because the epaper only can display white/black/red without shades). So, if you use the json template, you can just draw a red box, and use white text.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/OpenEPaperLink#2307