← Public packages
@kentcdodds/asteroids
Classic canvas Asteroids game with vector graphics, touch controls, and a saved high score.
scripts/shrink-icons.py
7 lines · 357 B · Python# Quantize rendered PNG icons to a 256-color palette (keeps alpha) to keep the app bundle small.
from PIL import Image
import glob
for f in glob.glob('public/icons/*.png') + ['.kody/icon.png']:
im = Image.open(f).convert('RGBA')
im.quantize(colors=256, method=Image.Quantize.FASTOCTREE, dither=Image.Dither.NONE).save(f, optimize=True)
print(f)