update emojifier generator
@@ -50,9 +50,6 @@ class Palette:
for row in img:
for pixel in row:
- if len(pixel) > 3 and pixel[3] < 255:
- return
-
avgs[0] += pixel[0]
avgs[1] += pixel[1]
avgs[2] += pixel[2]
@@ -69,7 +66,7 @@ class Palette:
[[int(avg / 128) for avg in avgs], image_file],
[[int(avg / 64) for avg in avgs], image_file],
[[int(avg / 32) for avg in avgs], image_file],
- {image_file: base64.b64encode(cv2.imencode(".png", img)[1]).decode("utf-8")},
+ {image_file: base64.b64encode(cv2.imencode(".png", cv2.resize(img, (16, 16)), cv2.IMWRITE_PAM_FORMAT_RGB_ALPHA)[1]).decode("utf-8")},
)
