This commit is contained in:
CiscoTheWolf 2023-05-21 23:42:51 +02:00
parent ebc96ecc56
commit 3aa8cb219f

View file

@ -33,18 +33,18 @@ def image_interpolation(image1, image2, alpha):
return interpolated_image
image = Image.open("faces/prootface1.bmp")
image = Image.open("faces/prootface3.bmp")
image.thumbnail((128, 32), Image.ANTIALIAS)
noBlinkImage = pure_pil_alpha_to_color_v2(image)
image = Image.open("faces/prootface2.bmp")
image = Image.open("faces/prootface4.bmp")
image.thumbnail((128, 32), Image.ANTIALIAS)
fullBlinkImage = pure_pil_alpha_to_color_v2(image)
DesiredBlinkState = 10
currentBlinkState = 0
blinkFrameCanvases = {}
for alpha in range(10):
for alpha in range(1,10):
offscreen_interpolated_canvas = matrix.CreateFrameCanvas()
offscreen_interpolated_canvas.brightness = 50
interpolated_image = image_interpolation(noBlinkImage, fullBlinkImage, alpha/10)
@ -56,10 +56,10 @@ offscreen_interpolated_canvasA.brightness = 50
interpolated_image.thumbnail((matrix.width, matrix.height), Image.ANTIALIAS)
blinkFrameCanvases[0] = offscreen_interpolated_canvasA.SetImage(noBlinkImage, unsafe=False)
offscreen_interpolated_canvas = matrix.CreateFrameCanvas()
offscreen_interpolated_canvas.brightness = 50
offscreen_interpolated_canvasB = matrix.CreateFrameCanvas()
offscreen_interpolated_canvasB.brightness = 50
interpolated_image.thumbnail((matrix.width, matrix.height), Image.ANTIALIAS)
blinkFrameCanvases[10] = offscreen_interpolated_canvas.SetImage(fullBlinkImage, unsafe=False)
blinkFrameCanvases[10] = offscreen_interpolated_canvasB.SetImage(fullBlinkImage, unsafe=False)
@ -74,7 +74,7 @@ def update_screen():
return
next_canvas = offscreen_interpolated_canvasA
next_canvas = blinkFrameCanvases[0]
if currentBlinkState < DesiredBlinkState:
currentBlinkState =+ 1