View source: R/extract-colours.R
image_to_pallette | R Documentation |
Develop a usable colour palette form an image.
image_to_pallette(
image_path,
resize_factor = NULL,
colour_space = "sRGB",
rgb_to_linear_func = NULL,
rgb_to_nonlinear_func = NULL,
method = "slic",
superpixel = 200,
compactness = 20,
verbose = TRUE,
s = negDistMat(r = 2),
summary_method = mean,
...
)
image_path |
A character path to the image to cluster. Reads images of type .png, .jpeg, .jpg, .tiff. |
resize_factor |
A numeric scalar that reduces (or increases) the size of the image before any processing. |
colour_space |
The colour space of the original image. The clustering is undertaken in the Lab space. This is an an option in |
rgb_to_linear_func |
The clustering is undertaken in the Lab space. This is a function to convert RGB colour space into linear RGB space. Used only if a custom transformation matrix is provided. Transformation skips if no function is provided under a user-defined transformation matrix. See: https://en.wikipedia.org/wiki/SRGB. |
rgb_to_nonlinear_func |
The clustering is undertaken in the Lab space. This is a function to convert linear RGB colour space into non-linear RGB space. Used only if a custom transformation matrix is provided. Transformation skips if no function is provided under a user-defined transformation matrix. See: https://en.wikipedia.org/wiki/SRGB. |
method |
From |
superpixel |
From |
compactness |
From |
verbose |
From |
s |
From |
summary_method |
Function to summarise colours in clustered superpixels. Defaults to |
... |
Other arguments to be passed to the apcluster algorithm. For the methods with signatures character,ANY and function,ANY, all other arguments are passed to the selected similarity function as they are; for the methods with signatures Matrix,missing and sparseMatrix,missing, further arguments are passed on to the apcluster methods with signatures Matrix,missing and dgTMatrix,missing, respectively. |
A schemr
object containing colour scheme colours and image properties and clusters.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.