FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bnuuyCode/ImageUtilities: A set of Python scripts for image processing tasks: resize images by max dimensions or file size, convert images between formats (JPG, PNG, WEBP) with automatic date-based folder organization, and validate product images against an Excel list, moving matches to a destination folder for easy management. · GitHub

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Hey friends!

Just a heads-up: one of the scripts (or all of them) deletes the original photos when moving the processed ones. I set it up that way because I was processing over 1,000 photos to populate a database and needed to save local storage space.

I’m too lazy to properly update this ancient repository or check if I actually mentioned this in the README.

I wrote this from scratch three years ago with help from YouTube and two senior dev friends; the code was really ugly before I ran it through GPT and uploaded it here um 2025.

This is basically a huge hack that saved me a lot of tedious work; it served me well, but it could be a disaster if you're processing important photos.

Image Processing Scripts

This repository contains three standalone Python scripts to simplify common image processing tasks, especially useful for batch operations and automating workflows.


1. Image Resizer Script

Resizes images based on maximum width/height or target file size, preserving the aspect ratio.

Features

  • Resize by max dimensions (width or height).
  • Resize by max file size (KB or MB).
  • Preserves image aspect ratio.

Usage Example

python image_resizer.py --input_folder ./images --output_folder ./resized --max_width 800 --max_height 600

Or resize by file size:

python image_resizer.py --input_folder ./images --output_folder ./resized --max_size_kb 200

2. Image Converter Script

Converts images between supported formats (JPG, PNG, WEBP, etc.) using the Pillow library. Automatically organizes converted images into folders by conversion date.

Features

  • Supports multiple source and target formats.
  • Auto-organizes outputs into date-based folders (YYYY-MM-DD).

Usage Example

python image_converter.py --input_folder ./images --output_folder ./converted --target_format png

3. Validate Product Images

Checks whether image files in a folder match product image names listed in an Excel spreadsheet. Matching images are moved to a specified destination folder.

Features

  • Reads product image names from an Excel file.
  • Moves matched images to a destination folder for easy organization.

Usage Example

python validate_product_images.py --images_folder ./product_images --excel_file ./products.xlsx --destination_folder ./validated_images

Requirements

  • Python 3.x
  • Pillow
  • pandas
  • openpyxl

Install dependencies:

pip install Pillow pandas openpyxl

Notes

  • Adjust paths and parameters as needed for your environment.
  • Each script is independent; run them separately as needed.
  • Scripts can be extended with additional command-line options if desired.

✧ made by bnnuy 🐇 in bnnuy code style ૮꒰ ˶• ༝ •˶꒱ა ♡

About

A set of Python scripts for image processing tasks: resize images by max dimensions or file size, convert images between formats (JPG, PNG, WEBP) with automatic date-based folder organization, and validate product images against an Excel list, moving matches to a destination folder for easy management.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL