fix: add alpha channel

will probably make this toggleable due to differences in images
This commit is contained in:
trafficlunar 2024-12-06 15:49:55 +00:00
parent b30ba187e9
commit 5ba53ac805
3 changed files with 277 additions and 277 deletions

View file

@ -10,7 +10,7 @@ output = Path("average_colors.json")
# Main function
def calculate(image_path):
image = Image.open(image_path)
image = image.convert("RGB")
image = image.convert("RGBA")
pixels = np.array(image)
color = pixels.mean(axis=(0, 1))
return tuple(int(c) for c in color)