Created
January 20, 2023 15:26
-
-
Save Metriximor/071ea57ced5d24e55683f49f82836126 to your computer and use it in GitHub Desktop.
Converts png files into dds file format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
from wand.image import Image | |
from pathlib import Path | |
root_dir = "./" | |
for png_image in glob.iglob(root_dir + "gfx/interface/**/*.png", recursive=True) and glob.iglob(root_dir + "gfx/coat_of_arms/**/*.png") and glob.iglob(root_dir + "gfx/models/**/*.png"): | |
with Image(filename=png_image) as open_image: | |
print(f"Converting {png_image} to .dds from .png") | |
open_image.compression='dxt5' | |
path = Path(png_image) | |
open_image.save(filename=path.with_suffix('.dds')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment