added console outputs + ico
This commit is contained in:
BIN
Texturing/OptimizeTextures/optimizeTextures.ico
Normal file
BIN
Texturing/OptimizeTextures/optimizeTextures.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
Binary file not shown.
@@ -2,6 +2,7 @@ from unittest import skip
|
|||||||
from PIL import Image
|
from PIL import Image
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
if len(sys.argv) < 1:
|
if len(sys.argv) < 1:
|
||||||
print("Please provide the input files.")
|
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.path.join(os.path.dirname(inputTexs[1]),"optimized")
|
||||||
|
|
||||||
#export_path = os.mkdir(os.path.join(os.path.dirname(inputTexs[1]),"optimized"))
|
print("Starting optimization of " + str(len(inputTexs)-1) + " Files")
|
||||||
#print (Input_filepath)
|
|
||||||
#print(inputTexs[1])
|
|
||||||
|
|
||||||
for i in range(1,len(inputTexs),1):
|
for i in range(1,len(inputTexs),1):
|
||||||
currentTex = Image.open(inputTexs[i])
|
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 = currentTex.resize((2048,2048),Image.LANCZOS)
|
||||||
|
|
||||||
resizedTex.save(str(export_path) + "\\" + os.path.basename(inputTexs[i]), optimize=True, quality=95)
|
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)
|
||||||
1
Texturing/OptimizeTextures/readme.md
Normal file
1
Texturing/OptimizeTextures/readme.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Build it using: python3 -m PyInstaller -F --icon=optimizeTextures.ico -c .\optimize_textures.py
|
||||||
Reference in New Issue
Block a user