makePaletteKM {makePalette} | R Documentation |
Make your color palette with KMeans algorithm
Description
Creates a color palette from an image, using the KMeans algorithm
Usage
makePaletteKM(photo, n = 4)
Arguments
photo |
Image location path. It can also be a URL address. |
n |
Number of elements to be generated in the color palette. The default value is 4. |
Value
A palette of colors
Examples
makePaletteKM(system.file("extdata", "picture02.jpg", package="makePalette"))
makePaletteKM(system.file("extdata", "picture04.png", package="makePalette"), 6)
makePaletteKM(system.file("extdata", "picture05.jpg", package="makePalette"), 10)
MyPalette = makePaletteKM(system.file("extdata", "picture05.jpg", package="makePalette"), 10)
barplot(1:10, col=MyPalette)
[Package makePalette version 0.1.2 Index]