Skip to content

ImageFont/ImageDraw should support text stroking #2209

@Irishsmurf

Description

@Irishsmurf

Hey,

Something that I find myself doing quite often when drawing text to an image is to stroke the text with a high-contrast outline.
I find this helps improve readability over cluttered backgrounds.

Neither pillow.ImageDraw nor pillow.ImageFont currently includes a function while allows ImageDraw to draw stroked text with a specific color outline.

It'd be pretty cool if ImageDraw.text() would include two additional method parameters.

  • One to indicate the size of the outline in pixels
  • One to indicate the colour of the outline (similar to the current fill parameter)

For example:

draw.text((10, 10), "hello", font=font, outline=BLACK, outline_size=2)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions