Code Monkey home page Code Monkey logo

colorpalette's Introduction

ColorPalette

Find the dominant colors in any image

Setup Instructions:

Step 1)

Make sure you have python installed on your machine

Step 2)

navigate into the main directory ColorPalette and create a python virtual environment as follows:

python3 -m venv env

Step 3)

Activate the virtual environment as follows:

source env/bin/activate

Step 4)

Install the required packages:

pip install -e .

Using the tool:

To use this tool place whatever image you want to analyze in the main ColorPalette folder and type the following:

./bin/run EXAMPLE_IMAGE.jpg NUM_COLORS

In the above, NUM_COLORS refers to the number of colors you want displayed. Additionally, you may follow NUM_COLORS with either a 0 or a 1 to specify whether you would like the hexadecimal color codes of each number to be displayed in the final picture.

Output

The tool will output two files into the main folder your image was initially in. The first file will be named YOUR_FILE_palette and will contain just the color palette. The second file will be called YOUR_FILE_with_palette and this will contain the original image with the palette below it.

Examples:

Image without color names

alt text

Image with color names

alt text

FAQ:

Will there be a batch edit feature?

Yes, I hope to make one soon.

How long does it take to run?

This varies wildly based on the size of the image but anywhere from 1 second to a minute

What file types does it support?

Currently this only works for .jpg and .png images but I hope to expand this in the future

When I look at this picture one color really stands out to my eye but the script didn't pick it up, why?

The human eye is designed to detect harsh contrast and abrupt changes so when there is a small amount of a color we can find it very overpowering. This script is designed to handle "dominant" colors and therefore may not pick up these small yet bright/contrasting colors your eye does. this being said, often it will pick these up if you just increase the number of colors its looking for by a couple.

Notes:

In the future I hope to add real time analysis so that it can display colors as you watch a movie.

colorpalette's People

Contributors

rodartha avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.