Skip to content

ImageFont/ImageDraw should support text stroking #2209

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)

Activity

  1. HinTak commented on May 8, 2017

    @HinTak
    Contributor

    https://github.com/rougier/freetype-py have a few examples doing that.

  2. Vastrix commented on Mar 24, 2018

    @Vastrix

    I agree, ImageFont could use some love! :s

  3. changed the title [-]FR: ImageFont/ImageDraw should support text stroking[/-] [+]ImageFont/ImageDraw should support text stroking[/+] on Mar 15, 2019
  4. radarhere commented on Jul 19, 2019

    @radarhere
    Member

    I've created PR #3978 to resolve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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