palettes {pliman} | R Documentation |
image_palette()
creates image palettes by applying the k-means algorithm
to the RGB values.
image_palette(
image,
npal,
filter = TRUE,
blur = FALSE,
parallel = FALSE,
workers = NULL,
verbose = TRUE
)
image |
An image object. |
npal |
The number of color palettes. |
filter |
Performs median filtering. This can be useful to reduce the
noise in produced palettes. Defaults to |
blur |
Performs blurring filter of palettes? Defaults to |
parallel |
Processes the images asynchronously (in parallel) in separate
R sessions running in the background on the same machine. It may speed up
the processing time when |
workers |
A positive numeric scalar or a function specifying the maximum number of parallel processes that can be active at the same time. |
verbose |
If |
image_palette()
returns a list with npal
color palettes of class Image
.
library(pliman)
img <- image_pliman("sev_leaf_nb.jpg")
pal <- image_palette(img, npal = 4)
image_combine(pal)
# runs only in an iterative section
if(FALSE){
image_palette_pick(img)
}