hex_extract: \lifecycleexperimental

View source: R/hex_extract.R

hex_extractR Documentation

\lifecycleexperimental

Description

Compute the average hex color of an image file

Usage

hex_extract(image)

Arguments

image

A cimg object which is an image file previously imported to the R session into R with imager::load.image (.png or .jpg)

Details

Use this function to quickly extract the average color of an image for display on screens. Helpful for visualization purposes and making realistic drawings in vector graphics software such as Adobe Illustrator.

Value

A character vector of length 1, containing average hexidecimal color of all pixels in the image

Examples

## Not run: 
"image_file_1" %>%
imager::load.image() %>%
hex_extract() 
## End(Not run)



evanmascitti/ecmfuns documentation built on April 5, 2025, 1:52 a.m.