Skip to content

Instantly share code, notes, and snippets.

@vslavik
vslavik / pngs-to-ico.py
Created April 10, 2024 18:10
Script to create ICO files from PNGs while preserving compresison
#!/usr/bin/env python3
#
# Create an .ico file from a bunch of PNGs.
# Unlike ImageMagick's convert, this does not convert PNGs into bitmaps or
# otherwise modify the source PNGs; in particular, their compression is
# preserved.
#
# ICO format is actually very simple:
# https://en.wikipedia.org/wiki/ICO_(file_format)
#

Keybase proof

I hereby claim:

  • I am vslavik on github.
  • I am vslavik (https://keybase.io/vslavik) on keybase.
  • I have a public key whose fingerprint is 5E7A 8F00 4258 988E ABA5 7FB3 C436 1AFD 4652 64C9

To claim this, I am signing this object: