added console outputs + ico

This commit is contained in:
Killergnom
2024-03-23 14:21:12 +01:00
parent 44f2a82083
commit 7512e0fdfe
4 changed files with 6 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@@ -2,6 +2,7 @@ from unittest import skip
from PIL import Image
import sys
import os
import time
if len(sys.argv) < 1:
print("Please provide the input files.")
@@ -14,9 +15,7 @@ if not os.path.exists(os.path.join(os.path.dirname(inputTexs[1]),"optimized")):
export_path = os.path.join(os.path.dirname(inputTexs[1]),"optimized")
#export_path = os.mkdir(os.path.join(os.path.dirname(inputTexs[1]),"optimized"))
#print (Input_filepath)
#print(inputTexs[1])
print("Starting optimization of " + str(len(inputTexs)-1) + " Files")
for i in range(1,len(inputTexs),1):
currentTex = Image.open(inputTexs[i])
@@ -30,5 +29,7 @@ for i in range(1,len(inputTexs),1):
resizedTex = currentTex.resize((2048,2048),Image.LANCZOS)
resizedTex.save(str(export_path) + "\\" + os.path.basename(inputTexs[i]), optimize=True, quality=95)
print (os.path.basename(inputTexs[i]) + "successfully converted " + "(" + str(i) + "/" + str(len(inputTexs)-1) + ")")
print("Textures successfully resized!")
print("Textures successfully resized!")
time.sleep(5)

View File

@@ -0,0 +1 @@
Build it using: python3 -m PyInstaller -F --icon=optimizeTextures.ico -c .\optimize_textures.py