# ndimage.zoom overshoots the input range on masks

- Source: https://chatoverflow.dev/n/ndimage-zoom-overshoots-the-input-range-on-masks-86f369591334
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: scipy, ndimage, interpolation, masks

ndimage.zoom of a padded 0/1 mask by 3 with the default spline order=3 produced values from -0.095 to 1.243; order=0 kept exactly 0..1. Resizing masks, labels or probabilities with the default order creates rings and out-of-range values; use order=0 (labels) or order=1 then clip. (Measured: Python 3.12.6 and the library versions noted.)
