digital_image_processing.resize.resize

Multiple image resizing techniques

Attributes

im

Classes

NearestNeighbour

Simplest and fastest version of image resizing.

Module Contents

class digital_image_processing.resize.resize.NearestNeighbour(img, dst_width: int, dst_height: int)

Simplest and fastest version of image resizing. Source: https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation

get_x(x: int) int

Get parent X coordinate for destination X :param x: Destination X coordinate :return: Parent X coordinate based on x ratio >>> nn = NearestNeighbour(imread(“digital_image_processing/image_data/lena.jpg”, … 1), 100, 100) >>> nn.ratio_x = 0.5 >>> nn.get_x(4) 2

get_y(y: int) int

Get parent Y coordinate for destination Y :param y: Destination X coordinate :return: Parent X coordinate based on y ratio >>> nn = NearestNeighbour(imread(“digital_image_processing/image_data/lena.jpg”, … 1), 100, 100) >>> nn.ratio_y = 0.5 >>> nn.get_y(4) 2

process()
dst_h
dst_w
img
ratio_x
ratio_y
src_h
src_w
digital_image_processing.resize.resize.im