ImageDraw.Draw(halo).text(position, text, font=font, fill=halo_col)
blurred_halo = halo.filter(ImageFilter.BLUR)
ImageDraw.Draw(blurred_halo).text(position, text, font=font, fill=col)
return Image.composite(img, blurred_halo, ImageChops.invert(blurred_halo))
if __name__ == '__main__':
    i = Image.open(sys.argv[1])
font = ImageFont.load_default()
txt = 'Example 1234'
text_col = 0, 255, 0
halo_col = 0, 0, 0
i2 = draw_text_with_halo(i, (20, 20), txt, font, text_col, halo_col)
i2.save('halo.png')
Create a halo around text in Python using PIL?