mirror of
https://github.com/trafficlunar/blockmatic.git
synced 2026-06-27 22:24:12 +00:00
fix: add alpha channel
will probably make this toggleable due to differences in images
This commit is contained in:
parent
b30ba187e9
commit
5ba53ac805
3 changed files with 277 additions and 277 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue