Angular rotation of an image

transform_rotate(
  img,
  angle,
  interpolation = 0,
  expand = FALSE,
  center = NULL,
  fill = NULL,
  resample
)

Arguments

img

A magick-image, array or torch_tensor.

angle

(numeric): Rotation angle value in degrees, counter-clockwise.

interpolation

(integer, optional): Interpolation mode. 0 for nearest, 2 for bilinear. Default is 0 (nearest).

expand

(logical, optional): Optional expansion flag. If TRUE, expands the output to make it large enough to hold the entire rotated image. If FALSE or omitted, make the output image the same size as the input image. Note that the expand flag assumes rotation around the center and no translation.

center

(numeric vector of length 2, optional): Optional center of rotation, c(x, y). Origin is the upper left corner. Default is the center of the image.

fill

(numeric vector or numeric): Pixel fill value for area outside the rotated image. If a single numeric value, the value is used for all channels. Defaults to 0 for all channels. This option is not supported for Tensor input. Fill value for the area outside the transform in the output image is always 0.

resample

Deprecated. Use interpolation instead.