INNER CODE UNIT · Python
list_png_files
McDevon/taxman-engine · Scripts/generate_sprite_sheet.py:10
def list_png_files(directory):
ong_files = []
for file in os.listdir(directory):
if pathlib.Path(file).suffix == '.png':
ong_files.append(file)
return ong_files
def image_data(path):
img = Image.open(path)
if img.mode == 'P':
img = img.convert('RGBA')
has_alpha = img.mode == 'RGBA'
is_monochrome = img.mode == 'L'
is_monochrome_alpha = img.mode == 'LA'
width, height = img.size
if has_alpha: