colors_kmeans: Colors from kmeans

Description Usage Arguments Value Examples

Description

Get projection on kmeans for colors of image.

Usage

1

Arguments

im

An image object of package Magick.

kmeans

An object of class kcca of package flexclust.

Value

A matrix of colors (in hex format, e.g. "#ffffff").

Examples

1
2
3
4
5
6
7
im0 <- magick::image_read("https://goo.gl/nRQi5n")
im <- magick::image_resize(im0, "100")
kmeans <- kmeans_colors(im, 5)
im_small <- magick::image_resize(im0, "30")
plot(im_small)
table(colors <- colors_kmeans(im_small, kmeans))
plot_color_matrix(colors)

privefl/pixelart documentation built on May 29, 2019, 7:39 a.m.