Skip to content

jcbain/cuttlefish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cuttlefish

cuttlefish is an R package that allows you to extract the distinct colors from images. This can be achieved in one of two ways:

  1. selecting n colors and finding those that are the farthest "close to" equidistant colors from one another.
  2. selecting the n most popular colors.

Installation

Currently, you can only install cuttlefish through the github repo.

# install dev version (the only version currently)
devtools::install_github("jcbain/cuttlefish")

# load cuttlefish
library(cuttlefish)

Usage

Imagine you have the following image and you thought, "Wow, I like those colors! I would like to make a color palette out of that."

Simple! How about a palette of 20 colors...

cols <- create_palette("path/to/image.png", n=20)
cols
 [1] "#D7E5B0" "#E1F7D0" "#0B5100" "#2E7D3B" "#ADC9BA" "#368773" "#F0FEFF" "#E1F4FF" "#FAFBFD" "#8F91CC"
[11] "#C7C3D2" "#B695D1" "#845E8B" "#E2D6E0" "#D8BCCB" "#DCC7CC" "#B79997" "#DFBEAB" "#F6F5F3" "#FFFEE1"

And how about taking a look at the color palette with the scales package.

scales::show_col(cols)

About

Extract a Color Palette from Your Photos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages