https://github.com/alwalxed/dominant-color-image-sort
Organizes images into folders based on their dominant color.
https://github.com/alwalxed/dominant-color-image-sort
color-analysis computer-vision data-sorting image-processing machine-learning python
Last synced: 3 months ago
JSON representation
Organizes images into folders based on their dominant color.
- Host: GitHub
- URL: https://github.com/alwalxed/dominant-color-image-sort
- Owner: alwalxed
- License: mit
- Created: 2024-06-09T16:13:14.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-06-23T10:05:40.000Z (11 months ago)
- Last Synced: 2025-01-15T19:17:13.459Z (4 months ago)
- Topics: color-analysis, computer-vision, data-sorting, image-processing, machine-learning, python
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dominant Color Image Sort
A handy Python script that takes a folder of images and sorts them into named folders based on their dominant color. Useful if you want to group random images by a single pattern, in this case: their dominant color.
## 🌟 Features
- Supports multiple image formats: PNG, JPG, JPEG, BMP, GIF, TIFF.
- Uses k-means clustering to determine the dominant color.
- Maps the dominant color to the closest predefined color name.
- Organizes images into folders named after the dominant color.## 💡 Usage
To sort images by their dominant color and move them to corresponding folders, run the following command:
```
python -m image_color_sorter.sorter /path/to/input/folder --destination_folder_base /path/to/output/folder
```## 📋 Example
```
python -m image_color_sorter.sorter ./images --destination_folder_base ./sorted_images
```This command will process all images in the ./images folder and sort them into subfolders in the ./sorted_images directory based on their dominant colors.
## 🔍 Installation
Clone the repository:
```
git clone https://github.com/alwalxed/dominant-color-image-sort.git
cd dominant-color-image-sort
```Install the required dependencies:
```
pip install -r requirements.txt
```## 📜 License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/alwalxed/dominant-color-image-sort/blob/main/LICENSE) file for details.
## 🤝 Contributing
Contributions are welcome! If you have any ideas, suggestions, or improvements, feel free to open an issue or create a pull request.
1. Fork the repository.
2. Create your feature branch.
3. Commit your changes.
4. Push to the branch.
5. Open a pull request.
6. Your contribution will be reviewed, and once approved, it will be merged into the main branch.Please make sure to update tests as appropriate.