Skip to content

Instantly share code, notes, and snippets.

@LightslicerGP
Last active July 31, 2025 17:15
Show Gist options
  • Select an option

  • Save LightslicerGP/6088569ab40225eeb0468dfe320bf9ab to your computer and use it in GitHub Desktop.

Select an option

Save LightslicerGP/6088569ab40225eeb0468dfe320bf9ab to your computer and use it in GitHub Desktop.
Minecraft Texture Pack Processor
realms
atlases
blockstates
equipment
font
items
lang
models
particles
post_effect
shaders
texts
waypoint_style
colormap
effect
font
gui
from PIL import Image
import shutil
import os
import time
base_images_folder = "Base Textures"
final_images_folder = "Final Textures"
folder_skip_list = "ignoreFolders.txt"
debug = False
if not os.path.exists(base_images_folder):
os.makedirs(base_images_folder)
if not os.path.exists(final_images_folder):
os.makedirs(final_images_folder)
with open(folder_skip_list, "r") as file:
ignore_folders = set(line.strip() for line in file.readlines())
def process_image(input_path, output_path):
print(f"'{output_path}'") if debug else None
return
def process_directory(base_images_folder, final_images_folder):
if not os.path.exists(final_images_folder):
os.makedirs(final_images_folder)
for item in os.listdir(base_images_folder):
if item in ignore_folders:
continue
source_path = os.path.join(base_images_folder, item)
target_path = os.path.join(final_images_folder, item)
if os.path.isdir(source_path):
process_directory(source_path, target_path)
elif item.endswith(".png"):
process_image(source_path, target_path)
elif item.endswith(".mcmeta"):
shutil.copy2(source_path, target_path)
start = time.time()
process_directory(base_images_folder, final_images_folder)
print("done") if debug else None
end = time.time()
total = end - start
(
print(
f"{int(total // 3600)}h {int((total % 3600) // 60)}m {int(total % 60)}s {int((total - int(total)) * 1000)}ms"
)
if debug
else None
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment