ImageFile.rotate

ImageFile.rotate(angle, resize=False, center=None, order=1, mode='constant', cval=0, clip=True, preserve_range=False)

Rotate image by a certain angle around its center.

Parameters:

angle (float) – Rotation angle in radians in clockwise direction.

Keyword Parameters:
resize (bool):

Determine whether the shape of the output image will be automatically calculated, so the complete rotated image exactly fits. Default is False.

center (iterable of length 2):

The rotation center. If center=None, the image is rotated around its center, i.e. center=(cols / 2 - 0.5, rows / 2 - 0.5). Please note that this parameter is (cols, rows), contrary to normal skimage ordering.

order (int):

The order of the spline interpolation, default is 1. The order has to be in the range 0-5. See skimage.transform.warp for detail.

mode ({‘constant’, ‘edge’, ‘symmetric’, ‘reflect’, ‘wrap’}):

Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad.

cval (float):

Used in conjunction with mode ‘constant’, the value outside the image boundaries.

clip (bool):

Whether to clip the output to the range of values of the input image. This is enabled by default, since higher order interpolation may produce values outside the given input range.

preserve_range (bool):

Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of Stpomer.Image.ImageArray.as_float.

Returns:

(ImageFile/ImageArray) – Rotated image

Notes

(pass through to the skimage.transform.warps.rotate function)