SciPy

scipy.misc.imresize

scipy.misc.imresize(arr, size, interp='bilinear', mode=None)[source]

Resize an image.

This function is only available if Python Imaging Library (PIL) is installed.

Parameters:

arr : ndarray

The array of image to be resized.

size : int, float or tuple

  • int - Percentage of current size.
  • float - Fraction of current size.
  • tuple - Size of the output image.

interp : str, optional

Interpolation to use for re-sizing (‘nearest’, ‘lanczos’, ‘bilinear’, ‘bicubic’ or ‘cubic’).

mode : str, optional

The PIL image mode (‘P’, ‘L’, etc.) to convert arr before resizing.

Returns:

imresize : ndarray

The resized array of image.

See also

toimage
Implicitly used to convert arr according to mode.
scipy.ndimage.zoom
More generic implementation that does not use PIL.

Previous topic

scipy.misc.imread

Next topic

scipy.misc.imrotate