image_keep_color {plothelper} | R Documentation |
Keep Some Colors Unchanged and Make Others into Grayscale
Description
This function keeps pixels with certain
colors unchanged and transforms
others into grayscale.
The function is in fact a wrapper of
magick::image_transparent
, so it
uses the latter's color
and fuzz
parameters. NOTE: the function only works
for fully opaque or fully
transparent (labelled as "transparent") pixels.
Usage
image_keep_color(x, color = NULL, fuzz = 10, result = "magick")
Arguments
x |
an image read into R
by |
color |
the same
as |
fuzz |
the same
as |
result |
if it is "magick" (default), the result is a magick image, if it is "raster", the result is a matrix. |
[Package plothelper version 0.1.9 Index]