multicolorfits.downsample_for_preview#

multicolorfits.downsample_for_preview(arr, max_size=512, order=1)[source]#

Downsample a 2D or RGB image so its longest side is at most max_size.

Intended for interactive GUI / notebook previews only. Final exports and publications should use the full-resolution arrays.

Uses skimage.transform.resize with anti-aliasing when shrinking; returns the input unchanged if it already fits.

Parameters:
  • arr (array) – 2D (ny, nx) or RGB (ny, nx, 3) array.

  • max_size (int) – Maximum pixels along the longest axis.

  • order (int) – Spline order for resize (1 = bilinear, default).

Returns:

array – Downsampled array, same dimensionality as the input.