title: How to convert 0-1 image float array to 0-255 int array
body: <pre class="lang-py prettyprint-override"><code>import matplotlib
  import numpy as np
  
  photo=plt.imread('Feynman.png')
  plt.figure
  plt.subplot(121)
  plt.imshow(photo)
  photo*=255
  plt.subplot(122)
  plt.imshow(photo)
  </code></pre>
  <ul>
  <li>Plot results in:
  <ul>
  <li><code>Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).</code> and only displays an image in the first subplot</li>
  </ul>
  </li>
  </ul>
  <p><a href="https://i.stack.imgur.com/S0mRY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S0mRY.png" alt="enter image description here" /></a></p>
  <ul>
  <li>Used image</li>
  </ul>
  <p><img src="https://i.stack.imgur.com/1VDZo.png" alt="the image I use" /></p>