1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-27 21:23:48 +00:00

Move to Pillow 10.x (#5489)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Ilia Sotnikov
2023-10-09 03:47:52 +03:00
committed by GitHub
parent e09c217fde
commit 412a866de8
6 changed files with 20 additions and 15 deletions

View File

@@ -151,7 +151,7 @@ async def to_code(config):
pos = 0
for frameIndex in range(frames):
image.seek(frameIndex)
frame = image.convert("LA", dither=Image.NONE)
frame = image.convert("LA", dither=Image.Dither.NONE)
if CONF_RESIZE in config:
frame = frame.resize([width, height])
pixels = list(frame.getdata())
@@ -259,7 +259,7 @@ async def to_code(config):
if transparent:
alpha = image.split()[-1]
has_alpha = alpha.getextrema()[0] < 0xFF
frame = image.convert("1", dither=Image.NONE)
frame = image.convert("1", dither=Image.Dither.NONE)
if CONF_RESIZE in config:
frame = frame.resize([width, height])
if transparent: