img_chop: Chop away borders from an image

View source: R/img_chop.R

img_chopR Documentation

Chop away borders from an image

Description

Chop away borders from an image

Usage

img_chop(x, top = 0, right = 0, bottom = 0, left = 0)

Arguments

x

input image (a imager::cimg() object).

top

number of pixels to chop from the top.

right

same, from the right.

bottom

same, from the bottom

left

same, from the left.

Value

The image with the pixels chopped off.

Examples

x <- img_read(system.file("extdata", "blob.jpg", package="morphr"))
img_show(x)
# chop off some pieces around the main object
img_chop(x, t=17, r=15, b=50, l=15) %>% img_show()
# just remove the legend
img_chop(x, b=31) %>% img_show()

jiho/morphr documentation built on May 11, 2024, 9:32 p.m.