From dae72040d378ced81663e30ce2f867f2a4baa1b4 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 16 Oct 2026 14:05:33 +1100 Subject: [PATCH] Do not use transparent ink --- src/PIL/ImageDraw.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PIL/ImageDraw.py b/src/PIL/ImageDraw.py index fa7104721c2..19098057112 100644 --- a/src/PIL/ImageDraw.py +++ b/src/PIL/ImageDraw.py @@ -149,7 +149,11 @@ def _getink( ink = ImageColor.getcolor(ink, self.mode) if self.palette and isinstance(ink, tuple): ink = self.palette.getcolor(ink, self._image) - result_ink = self.draw.draw_ink(ink) + if isinstance(ink, tuple) and len(ink) == 4 and ink[3] == 0: + # Do not use transparent ink + result_ink = None + else: + result_ink = self.draw.draw_ink(ink) if fill is not None: if isinstance(fill, str): fill = ImageColor.getcolor(fill, self.mode)