pythoshop.resize_image
Module Contents
Functions
|
Image Resizing Function |
- pythoshop.resize_image.resize_image(image, height, width, method='crop', verbose=False)[source]
Image Resizing Function
This function takes an image and adjusts it to have the inputted dimensions using the selected method.
Parameters: - image (numpy.ndarray): The input image array. - height (int): The desired height for the image. - width (int): The desired width for the image. - method (str, optional): The method to obtain the desired image dimensions.
- Options: ‘maintain_aspect_ratio’ (default) for maintaining the aspect ratio,
‘crop’ for cropping to the specified dimensions, ‘add_borders’ for adding borders to maintain the aspect ratio.
verbose (bool, optional): If True, print verbose information. False is the default.
Returns: - Image Numpy Array The resized image is returned as a numpy array.
Raises: - ValueError: If an invalid resize method is provided.