import os
from PIL import Image

current_directory = os.path.abspath(os.path.dirname(__file__))
parent_directory = os.path.abspath(os.path.join(current_directory, ".."))
data_directory = os.path.join(parent_directory, "data")
raw_directory = os.path.join(data_directory, "bmp")


for file in os.listdir(raw_directory):
	if not os.path.isfile(os.path.join(raw_directory, file)):
		continue

	file_name, extension = os.path.splitext(file)

	image = Image.open(os.path.join(raw_directory, file))

	encode_type = "png"

	image.save(os.path.join(data_directory, encode_type, f"{file_name}.{encode_type}"))


