| Title: | R Package for Color Palette Generation Using the 'palettize' C++ Library |
|---|---|
| Description: | R package for color palette generation using the 'palettize' C++ library. |
| Authors: | Gustavo Velásquez [aut, cre], Isabella Velásquez [aut], gvlsq [aut] |
| Maintainer: | Gustavo Velásquez <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-31 08:57:06 UTC |
| Source: | https://github.com/gvelasq/palettizer |
plt_check() is a wrapper around the C++ function stbi_info from
stb_image.h. It checks whether a file is an image from a supported format.
This is useful for checking whether plt_tize() can create a color palette
from a file without having to decode the entire file.
plt_check(path)plt_check(path)
path |
A path to a file to be checked. |
Future versions of this function will expose how to query the width, height, and component count of an image.
plt_check() returns TRUE if the file is an image from a supported format,
and returns FALSE for non-image files and images from unsupported formats.
plt_tize() creates a color palette from a supported image file.
plt_tize(path, cluster_count, seed, sort_type = "weight")plt_tize(path, cluster_count, seed, sort_type = "weight")
path |
A path to a supported image file. |
cluster_count |
The number of clusters for k-means clustering. |
seed |
An integer to specify the seed for the random number generator. |
sort_type |
A character vector, one of "weight" (the default), "red", "green", or "blue". |
A character vector of hexadecimal colors.