ColorPalette
A simple web app to extract dominant colors from an image.
Demo
Live
View it live at : https://colorpalettedemo.herokuapp.com/
You can deploy your own instance on heroku by clicking the following button
What it do
Extracts 10 dominating colors from the image and adds the palette to the bottom of the image (inspired by colorpalette.cinema). You can adjust the palette height, outline color, and width to match your image dimension. Another independent image of the palette with the hex codes of colors is also generated.
The app does not depend on any APIs for extracting colors. color.py
contains the code for it with Pillow as the only dependency.
Some samples
- Photo by Alexandre Chambon on Unsplash
- Photo by Federica Diliberto on Unsplash
- Photo by Ashim DβSilva on Unsplash
Directory Structure
|-- Procfile |-- README.md |-- app.json |-- colorpalette | |-- __init__.py | |-- color.py | |-- forms.py | |-- routes.py | |-- static | | |-- css | | |-- font | | |-- images | | | |-- favicon | | `-- js | `-- templates | |-- 413.html | |-- base.html | |-- index.html | `-- picture.html |-- config.py |-- requirements.txt |-- run.py `-- LICENSE
Run locally
- Clone the repostory:
git clone https://github.com/makkoncept/colorpalette.git
- Navigate to the project root and create a virtual environment:
python3 -m venv venv
- Activate the virtual environment:
Linux:
source venv/bin/activate
Windows cmd:
venv\Scripts\activate.bat
- Install requirements:
pip install -r requirements.txt
- Run the development server:
python run.py
- View on localhost:5000
Attribution
Icon made by Freepik from www.flaticon.com