plot_colors: Create treemaps of image color compositions

Description Usage Arguments Examples

Description

plot_colors creates a treemap of colors extracted from Windows BMP, JPEG, PNG, TIFF, and SVG format images with the get_colors function.

Usage

1
plot_colors(data, sort = "color", labels = TRUE)

Arguments

data

a data.frame from a get_colors call consisting of the columns col_hex, col_freq, col_share.

sort

specifies the sorting of the treemap rectangles. By default ("color"), the rectangles are sorted by hex color codes, starting in the upper left corner. With ("size") the largest rectangle is placed top left.

labels

by default, rectangles that are sufficiently large are provided with a label. If FALSE, then no labels are displayed.

Examples

1
2
3
4
5
6
# Extract all colors
pic1 <- system.file("extdata", "pic1.png", package = "colorfindr")
col <- get_colors(pic1)

# Plot image composition
plot_colors(col)

colorfindr documentation built on May 2, 2019, 12:39 p.m.