imagenie.flip

imagenie.flip#

Functions#

flip(image[, direction])

Flips an image either horizontally or vertically.

Module Contents#

imagenie.flip.flip(image, direction=0)[source]#

Flips an image either horizontally or vertically.

Parameters:#

imagenp.ndarray

The input image to be flipped, represented as a NumPy array or similar format.

directionstr, optional

The direction in which to flip the image: - 0: for horizontal flip (default) - 1: vertical flip

Returns:#

np.ndarray

The flipped image as a NumPy array.

Raises:#

ValueError

If the specified direction is not 1 or 0. If image exceeds size limits.

Examples:#

Flip an image horizontally: >>> flipped_image = flip_image(image)

Flip an image vertically: >>> flipped_image = flip_image(image, 1)