scistag.imagestag.interpolation.InterpolationMethod

class InterpolationMethod(value)[source]

Bases: Enum

Enumeration of image interpolation methods

Methods

to_cv

Maps the enum to the corresponding OpenCV type

to_pil

Maps the enum to the corresponding PIL type

Attributes

NEAREST

The pixel will be kept intact, the upscaled image has quite hard pixel edges and the downscaled image is noisy

LINEAR

Linear interpolation.

CUBIC

Cubic interpolation.

LANCZOS

The highest image rescaling quality available in cv2/PIL.

__doc__

__members__

__module__

to_cv()[source]

Maps the enum to the corresponding OpenCV type

Returns

The OpenCV constant

to_pil()[source]

Maps the enum to the corresponding PIL type

Returns

The PIL constant

CUBIC = 2

Cubic interpolation. Matches the pixels of the source region to the image region and tries to preserve contours

LANCZOS = 3

The highest image rescaling quality available in cv2/PIL. Use this if performance is not the most important

LINEAR = 1

Linear interpolation. Mixes up to four colors based upon subpixel position.

NEAREST = 0

The pixel will be kept intact, the upscaled image has quite hard pixel edges and the downscaled image is noisy