Coder Social home page Coder Social logo

yuxhe / palette Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ubadub/palette

0.0 0.0 0.0 323 KB

A Python utility to create color palettes based off of an image. Uses k-means clustering to generate an RGB shades palette based off of the predominant colors of the source image. User can customize the number of colors in the generated palette.

Python 100.00%

palette's Introduction

Palette

A Python utility to create color palettes based off of an image. Uses k-means clustering to generate an RGB shades palette based off of the predominant colors of the source image. User can customize the number of colors in the generated palette.

Tested for Python 3.7, but should work for Python 3.2+

How To Use

Download/clone somewhere on your computer and download the requirements in the Pipfile. Put the source image in the same directory and then run the program with python. Run it with the following command line arguments:

usage: palette.py [-h] [-s [image source]] [-n [number of colors]]

Generate a color palette based on a source image.

optional arguments:
  -h, --help            show this help message and exit
  -s [image source], --src [image source]
                        Path to the source image (default: None)
  -n [number of colors], --number [number of colors]
                        Number of colors in the palette (default: 8)

If an image source isn't provided in a command line argument, the program will ask you for one upon invocation.

Using values of n greater than ~16 will produce mediocre results. The suggested (and default) value is 8, but play around with the number depending on your source image.

In a few seconds it will display the palette, which you can then save wherever.

palette's People

Contributors

ubadub 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.