Skip to content

Get all colors from an image and generate a palette of the colors.

License

Notifications You must be signed in to change notification settings

jaredegan/generate-palette-rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generate Color Palettes

A ruby script that generates a color palette image containing all of the colors in a given set of images, sorted by hue. This is using ImageMagick / RMagick

Prerequisites

Usage & Examples

You can pass in any number of command line arguments, which can be images or directories. If you pass in a directory, the script will use all the images in that directory (it won't recurse into subdirectories, though). The script will generate palette.png, containing all the colors.

ruby gen_palette.rb sample_imgs

or

ruby gen_palette.rb sample_imgs/smw_tiles.png sample_imgs/smw_enemies.png

This turns these two images:

Into this palette image:

TODO

The color sort is only OK, but my lack of color knowledge prevents me from making it much better.

Feedback & pull requests welcome!

About

Get all colors from an image and generate a palette of the colors.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages