techage_modpack/techage/textures/shrink.py
2021-02-07 14:37:07 +01:00

17 lines
481 B
Python

import os, fnmatch
print(">>> Convert")
for filename in os.listdir("./"):
if fnmatch.fnmatch(filename, "*.png"):
print(filename)
os.system("pngquant --skip-if-larger --quality=60-80 --strip --output ./%s.new ./%s" % (filename, filename))
print("\n>>> Copy")
for filename in os.listdir("./"):
if fnmatch.fnmatch(filename, "*.new"):
print(filename)
os.remove("./" + filename[:-4])
os.rename("./" + filename, "./" + filename[:-4])