# Palette-quantizes the generated PNG icons to keep the embedded bundle small. import glob from PIL import Image for f in glob.glob('public/icons/*.png') + ['.kody/icon.png']: im = Image.open(f) if im.width < 64: continue im = im.convert('RGBA').quantize(colors=160, method=Image.Quantize.FASTOCTREE, dither=Image.Dither.NONE) im.save(f, optimize=True) print(f, im.size)