I want to add or subtract two arrays in numpy but the result has to be bounded for each element. If I restrict the typ (i.e. uint8) any exeeding sum produces an overflow (i.e. start from zero again) and any exeeding difference an underflow (i.e. start from 255 again). This is not what I want, i.e. I want to stop at 0/255 (in my example).
Is there any way to do this without accessing each element?
Thank you in advance.