Files
dae16-VerhulstBram-GameProject/Resources/tiles/dirt/ConvertTexture.py
Bram Verhulst d6bb3add26 Added the Grid, Camera, Level system
Basic player
Started (Barely) on the TextureManager
And other fixes
2024-03-11 03:29:44 +01:00

31 lines
975 B
Python

import os
from PIL import Image
def convert_to_32bit(file_path):
try:
# Open the image
image = Image.open(file_path)
# Convert to 32-bit color depth
if image.mode != 'RGBA':
image = image.convert('RGBA')
# Save the converted image
converted_file_path = file_path.replace('.png', '_32bit.png')
image.save(converted_file_path)
print(f"Conversion complete for '{file_path}'. Saved as '{converted_file_path}'")
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
script_directory = os.path.dirname(os.path.realpath(__file__))
png_files = [f for f in os.listdir(script_directory) if f.lower().endswith('.png')]
if not png_files:
print("No .png files found in the script directory.")
else:
for file_name in png_files:
file_path = os.path.join(script_directory, file_name)
convert_to_32bit(file_path)