mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-09 15:00:58 +00:00
fix(python): fix toif generation from grayscale
[no changelog]
This commit is contained in:
parent
f10dc86da2
commit
a8e5d471fe
@ -94,7 +94,7 @@ def _from_pil_grayscale(
|
||||
data = bytearray()
|
||||
|
||||
for y in range(0, height):
|
||||
for x in range(0, width & (width - 1), 2):
|
||||
for x in range(0, width & ~1, 2):
|
||||
i = y * width + x
|
||||
|
||||
left, right = pixels[i], pixels[i + 1]
|
||||
@ -121,7 +121,7 @@ def _from_pil_grayscale_alpha(
|
||||
) -> bytes:
|
||||
data = bytearray()
|
||||
for y in range(0, height):
|
||||
for x in range(0, width & (width - 1), 2):
|
||||
for x in range(0, width & ~1, 2):
|
||||
i = y * width + x
|
||||
left_w_alpha, right_w_alpha = pixels[i], pixels[i + 1]
|
||||
left = int((left_w_alpha[0] * left_w_alpha[1]) / 255)
|
||||
|
Loading…
Reference in New Issue
Block a user