palette_visualize: Visualize the color palette of an image

View source: R/pictplot.R

palette_visualizeR Documentation

Visualize the color palette of an image

Description

Visualize the color palette of an image

Usage

palette_visualize(
  im,
  palette,
  type = "bar",
  threshold = 1,
  monospace = FALSE,
  width,
  size,
  outline_width = 0,
  outline_color = c(0.5, 0.5, 0.5),
  margin = 0
)

Arguments

im

an image

palette

color palette

type

either "bar" or "circle

threshold

minor colors below this threshold is not displayed

monospace

either TRUE or FALSE. If FALSE, If FALSE, the length of the color chart is proportional to the percentage of occurrences of that color in the image.

width

width of color chart. A numeric value between 0 and 1.

size

output image resolution. Only works for the circle type. The default is 1024.

outline_width

outline width of color chart. The default is 0 (no outline).

outline_color

outline color.

margin

margin between picture and color chart. Only works for the bar type. A numeric value between 0 and 1. The default is 0.

Examples

palette = palette_extract(regatta)
im = palette_visualize(regatta, palette$df, "bar")
plot(im)
im2 = palette_visualize(regatta, palette$df, "circle")
plot(im2)

tsuda16k/pictplot documentation built on March 1, 2023, 8:44 p.m.