The function is similar to
image_modify_local
but with different
parameters. It modifies both a subregion
of the image and the whole image, and then
combines them. The subregion can be chosen
either by numeric values or by mouse click ,which
is the same as image_modify_local
.
image_modify_local2(x, FUN1, FUN2 = NULL, geometry = "click", rectangle = TRUE)
an image read into R by
magick::image_read
or an image
modified by functions in the magick
package.
a function to modify
a subregion of x
. NOTE: the result
of these functions must be of the same class
as x
and should not change the sizes
of the subregion.
a function to modify the whole image, which must not change the size of the image. If it is NULL (default), nothing will do to the whole image.
this parameter is
different from the one used in package
magick. Here, in this function, you can
set geometry = "click"
if you want
to show which part is the subregion
by mouse click (see
function image_crop_click
for how to
use mouse click). Otherwise, you can use
a length 4 vector with the exact order: left,
right, top, bottom.
if it is TRUE (default),
the subregion is a rectangle area. If
it is FALSE, the subregion is
an irregular polygon area, and, now
geometry
is ignored, you must
designate the area by mouse click.