image_modify_local2: Modify both a Subregion and the Whole of an Image

Description Usage Arguments

View source: R/image_modify_local2.R

Description

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.

Usage

1
image_modify_local2(x, FUN1, FUN2 = NULL, geometry = "click", rectangle = TRUE)

Arguments

x

an image read into R by magick::image_read or an image modified by functions in the magick package.

FUN1

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.

FUN2

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.

geometry

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.

rectangle

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.


plothelper documentation built on July 2, 2020, 4:03 a.m.