title: Truncate a big integer to a uint8 type in Python
body: <p>I'm casting an array that is populated with signed 32-bit integers to an array with only uint8 values (from 0 to 255).
  Right now, my code looks like this:</p>
  
  <pre><code>newArray = Image.fromarray(oldArray.astype(numpy.uint8))
  </code></pre>
  
  <p>The thing is: I want the numbers lower than zero to become zero, and the numbers higher than 255 to become 255, and this code obviously doesn't operate like that.</p>
  
  <p>Is there an easy way to do it without iterating through the whole array?</p>