icons/svg2png.py
raw| 1 | """Support PNG generator from SVG.""" |
| 2 | |
| 3 | from os import makedirs |
| 4 | |
| 5 | from gi.repository.GdkPixbuf import Pixbuf |
| 6 | |
| 7 | |
| 8 | def main(): |
| 9 | """Create the png files from svg.""" |
| 10 | for size in (16, 22, 24, 32, 48, 64, 128, 256, 512): |
| 11 | icon = Pixbuf.new_from_file_at_scale("formiko.svg", size, size, True) |
| 12 | makedirs(f"{size}x{size}") |
| 13 | icon.savev(f"{size}x{size}/formiko.png", "png", [], []) |
| 14 | |
| 15 | |
| 16 | if __name__ == "__main__": |
| 17 | main() |