A script to optimize all images in the same directory and its subdirectories (this also removes EXIF data). Optimized images are stored in a separate folder, so the original images are not modified.
GitHub Copilot wrote 90% of this, I was in a rush lol
{
"optimization": {
"original_folder": "original",
"optimized_folder": "optimized",
"quality": 25,
"resizing": {
"enabled": true,
"max_width": 4096,
"max_height": 3072,
"upscale": false
}
}
}original_folder: The folder where the original images are locatedoptimized_folder: The folder where the optimized images will be savedquality: The quality of the optimized images (0-100)resizing: Options for image resizingenabled: Whether to resize imagesmax_width: The maximum width of the optimized imagesmax_height: The maximum height of the optimized imagesupscale: Whether to upscale images that are smaller than the max dimensions