HUMAN BODY AS WEAPON

10 months ago
2

from PIL import Image
import os
from flask import Flask, send_from_directory

app = Flask(__name__)

def jpg_to_png(input_folder, output_folder):
for filename in os.listdir(input_folder):
if filename.endswith(".jpg"):
img_path = os.path.join(input_folder, filename)
img = Image.open(img_path)

# Change the extension to .png in the output folder
output_path = os.path.join(output_folder, os.path.splitext(filename)[0] + ".png")

# Save the image as PNG
img.save(output_path, "PNG")
print(f"Converted {filename} to {output_path}")

Loading comments...