image_modifier.rotate_90

Module Contents

Functions

rotate_90(image)

Rotate an image by 90 degrees clockwise.

image_modifier.rotate_90.rotate_90(image)[source]

Rotate an image by 90 degrees clockwise.

Parameters:

image – A jpeg image image with 3 channels. (This image is converted to an array for easy manipulation)

Returns:

A new 3D array representing the rotated image.

Return type:

array

Example: >>> original_image = np.array([[[255, 0, 0], # Red

[0, 255, 0], # Green [0, 0, 255], # Blue [255, 255, 0]], # Yellow

[[128, 128, 128], # Gray

[255, 127, 0], # Orange [0, 255, 255], # Cyan [255, 0, 255]]]) # Magenta

>>> rotated_image = rotate_90(original_image)
>>> print(rotated_image)

np.array([[[128, 128, 128], [255, 0, 0]],

[[255, 127, 0],

[ 0, 255, 0]],

[[ 0, 255, 255],

[ 0, 0, 255]],

[[255, 0, 255],

[255, 255, 0]]])