Update src/PIL/ImageDraw.py

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Zach Nagengast 2023-12-01 22:56:59 -08:00 committed by GitHub
parent e80002643d
commit bd2977c518
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -543,7 +543,7 @@ class ImageDraw:
# font.getmask2(mode="RGBA") returns color in RGB bands and mask in A
# extract mask and set text alpha
color, mask = mask, mask.getband(3)
ink_alpha = struct.pack("=i", ink)[3]
ink_alpha = struct.pack("i", ink)[3]
color.fillband(3, ink_alpha)
x, y = coord
self.im.paste(color, (x, y, x + mask.size[0], y + mask.size[1]), mask)