recolor_phylopic: Recolor a PhyloPic image

View source: R/phylopic_utils.R

recolor_phylopicR Documentation

Recolor a PhyloPic image

Description

Function to recolor and change alpha levels of a PhyloPic image.

Usage

recolor_phylopic(
  img,
  alpha = 1,
  color = NULL,
  fill = NULL,
  remove_background = TRUE
)

Arguments

img

A Picture or png array object, e.g., from using get_phylopic().

alpha

numeric. A value between 0 and 1, specifying the opacity of the silhouette.

color

character. Color to make the outline of the silhouette. If NULL, the outline color is not changed.

fill

character. Color to make the body of the silhouette. If NULL, the body color is not changed.

remove_background

logical. Should any white background be removed? Only useful if img is a Picture object. See details.

Details

Some PhyloPic silhouettes do not have a transparent background. Consequently, when color is used with vectorized versions of these images, the entire image–including the background–is recolored. Setting remove_background to TRUE (the default) will remove any white parts of the image (which should only be the background).

Value

A Picture or png array object (matching the type of img)

See Also

Other transformations: flip_phylopic(), rotate_phylopic()


sckott/rphylopic documentation built on April 4, 2024, 3:55 p.m.