Description Usage Arguments Value Examples
Colors in colors are binned to the closest colors in centers based
on Euclidean distance in the color space provided in colorspace. These
are then tabulated to give the number of pixels of each color in centers.
1 | count_colors(colors, centers, colorspace)
|
colors |
colors to be tabulated as a colorspace::color object, e.g. colorspace::RGB. |
centers |
colors to be used for binning as a colorspace::color object, e.g. colorspace::RGB. |
colorspace |
string describing the colorspace in which distances should
be calculated, e.g. |
tibble with as many rows as centers with the columns freq and
hex, as well as columns corresponding to the dimensions of colorspace
1 2 3 4 5 | example_jpg <- system.file("extdata", "example.JPG", package = "routes")
read_pixels(example_jpg) %>%
colorspace::RGB() %>%
count_colors(centers = colorspace::RGB(c(1, 0, 0), c(0, 1, 0), c(0, 0, 1)),
colorspace = "RGB")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.