diff --git a/scikits/image/util/dtype.py b/scikits/image/util/dtype.py index b859f044..b1b5600d 100644 --- a/scikits/image/util/dtype.py +++ b/scikits/image/util/dtype.py @@ -75,7 +75,10 @@ def _convert(image, dtype, prec_loss): # Do scaling/shifting calculations in floating point image = image.astype(np.float64) - out = round_fn((image - imin) * scale + shift).astype(dtype) + out = image - imin + out *= scale + out += shift + out = round_fn(out).astype(dtype) return out