[SciPy-User] overflow

Mr Nilsson super.inframan@gmail....
Sat Jul 10 15:21:52 CDT 2010

Im working on a photo processing tool using numpy arrays to store the
pixel data. I am currently in the process of adding 8 and 16bit
support to my system in addition to float32.
The problem is that when working with uint8 and uint16 numpy overflows
the values of my pixels when I for example multiply (brighten) an
image, making bright pixels dark again.

Is there a way to have numpy clip the values to the maximum value of
whatever dtype is used instead of overflowing?


More information about the SciPy-User mailing list