Skip to content

This Python script categorizes images in a specified folder into 'red,' 'green,' or 'blue' subfolders based on their predominant color. It supports various image formats, employing different processing methods for raw files and standard formats, providing an efficient tool for organizing diverse image collections.

Notifications You must be signed in to change notification settings

khchuang12/RGB-File-Separator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Image Color Classifier

This Python script efficiently classifies images based on their average color and organizes them into color-specific folders. It supports a variety of image formats, including raw files.

Features

  • Color Classification: Determines the average color of each image by computing the mean of its RGB channels.
  • Organized Sorting: Categorizes images into "red," "green," and "blue" folders based on their predominant color.
  • Format Compatibility: Supports common image formats (.jpg, .jpeg, .png, .gif) and various raw file formats (.arw, .cr2, .nef, .dng).

Dependencies

  • rawpy: Used for reading and processing raw image files.
  • PIL (Pillow): Handles image processing for non-raw formats.
  • NumPy: Enables efficient numerical operations for array manipulations.

Usage

  1. Clone Repository:
    git clone https://github.com/your-username/image-color-classifier.git
  2. Navigate to Project Folder
    cd image-color-classifier
  3. Install Dependencies
    pip install rawpy pillow numpy
  4. Run the Script
    python image_classifier.py
  5. Specify Input Folder Replace the input_folder variable with the path to your local image folder in the script.

Example

  • Consider running the script on a folder containing a mix of JPEG, PNG, and RAW image files. The script will create subfolders ('red', 'green', 'blue') and organize images based on their predominant color.
    python image_classifier.py
    

Contributing

  • Contributions are welcome! Feel free to open issues, submit feature requests, or create pull requests to enhance the functionality of the script.

About

This Python script categorizes images in a specified folder into 'red,' 'green,' or 'blue' subfolders based on their predominant color. It supports various image formats, employing different processing methods for raw files and standard formats, providing an efficient tool for organizing diverse image collections.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages