This is a Python Flask application that allows users to upload images and analyze the dominant colors in the image using KMeans clustering algorithm. The application uses Flask framework for web development, Bootstrap for styling, and PIL (Python Imaging Library) for image processing.
- Allows users to upload images.
- Analyzes the dominant colors in the uploaded image.
- Displays the dominant colors and their occurrences as a JSON response.
- Provides a simple web interface for users to interact with.
- Clone the repository:
git clone https://github.com/jakubswi/Image-Colour-Palette-Generator.git cd image-color-analyzer
- Install the required dependencies:
pip install -r requirements.txt
-
Run the Flask application:
python app.py
-
Open your web browser and go to
http://localhost:5000
to access the application. -
Upload an image using the provided form.
-
Click the "Upload" button to analyze the dominant colors in the image.
-
The application will display the dominant colors and their occurrences as a JSON response.
- The Flask application uses a secret key for CSRF protection. You can modify the
SECRET_KEY
in theapp.py
file. - Uploaded images are stored in the
uploads
directory. You can change the upload destination by modifying theUPLOADED_PHOTOS_DEST
variable in theapp.py
file.
- Flask
- Flask-Bootstrap
- Flask-Uploads
- Flask-WTF
- NumPy
- Pillow
- scikit-learn (sklearn)
Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.