#!python # -*- mode: python; Encoding: utf-8; coding: utf-8 -*- # Last updated: <2021/10/01 21:48:33 +0900> """ Make sequential number image with ImageMagick. Windows10 x64 21H1 + Python 3.9.5 64bit + ImageMagick 7.1.0-5 Q16 x64 """ import os import subprocess mgk = "magick convert" size = "-size 96x96" pos = "-gravity center" font = "-font Inconsolata-Bold" col = "-fill black" bg = "-background rgba(0,0,0,0)" pt = "-pointsize 40" for i in range(8 * 8): lbl = "%04d" % i fn = "png32:out/%04d.png" % i cmd = f"{mgk} {size} {pos} {font} {col} {bg} {pt} label:{lbl} {fn}" subprocess.call(cmd) print("Output: %s" % fn)