bug fixing, and change the interpolation function to work with pillow.

This commit is contained in:
CiscoTheWolf 2023-05-21 23:09:07 +02:00
parent 912ffd8e5d
commit c1012bae29

View file

@ -29,19 +29,17 @@ def image_interpolation(image1, image2, alpha):
alpha = max(0, min(1, alpha))
# Perform interpolation
interpolated_image = np.uint8((1 - alpha) * image1 + alpha * image2)
interpolated_image = Image.blend(image1, image2, alpha)
return interpolated_image
image = Image.open("ciscoTheProot/faces/prootface1.bmp")
image = Image.open("faces/prootface1.bmp")
image.thumbnail((128, 32), Image.ANTIALIAS)
RGBImage = pure_pil_alpha_to_color_v2(image)
noBlinkImage = np.array(RGBImage, dtype=np.uint8)
noBlinkImage = pure_pil_alpha_to_color_v2(image)
image = Image.open("ciscoTheProot/faces/prootface2.bmp")
image = Image.open("faces/prootface2.bmp")
image.thumbnail((128, 32), Image.ANTIALIAS)
RGBImage = pure_pil_alpha_to_color_v2(image)
fullBlinkImage = np.array(RGBImage, dtype=np.uint8)
fullBlinkImage = pure_pil_alpha_to_color_v2(image)
DesiredBlinkState = 0
currentBlinkState = 0