image_modify_rgb {plothelper} | R Documentation |
Modify R, G, B Values of an Image
Description
The function modifies the R, G, B values
of an image and is used in the same
way as image_modify_hsv
in this package. The
three channels can be modified separately.
The ways to modify include: setting values
to some specified values (set_*), adding (add_*),
multiplying the original values (mult_*),
rescaling the original values (rescale_*),
using a function to recompute values (fun_*).
The most useful way is to use some internal
curves that mimic those PS-like apps.
Usage
image_modify_rgb(
x,
set_r = NULL,
add_r = NULL,
mult_r = NULL,
rescale_r = NULL,
fun_r = NULL,
set_g = NULL,
add_g = NULL,
mult_g = NULL,
rescale_g = NULL,
fun_g = NULL,
set_b = NULL,
add_b = NULL,
mult_b = NULL,
rescale_b = NULL,
fun_b = NULL,
result = "magick",
res = 144
)
Arguments
x |
an image created
by |
set_r |
set r values with specific values. |
add_r |
add specific values to current R values. |
mult_r |
multiply the current values with specific values. |
rescale_r |
a length 2 numeric vector
specifying the desired range of R values,
e. g., |
fun_r |
your own modifying function
(e. g., |
set_g , add_g , mult_g , rescale_g , fun_g |
parameters to change G values. Used in the same way as those for R. See above. |
set_b , add_b , mult_b , rescale_b , fun_b |
parameters to change B values. Used in the same way as those for R. See above. |
result |
the default is "magick", the output is
a magick picture. When it is "raster", a matrix is created
which can be use as a raster
for |
res |
when the result is a magick picture, the
|
Details
Several internal curves can be used.
Please see the Details part
of image_modify_hsv
.