title: Python - Convert image to a string of pixel values
body: <p>I have a .jpg image captured from a webcam. It is a greyscale image. I need to convert the image to a string of its pixels like so:</p>
  
  <pre><code>"255 232 45 678 56 23....345 76 44 767 433 345"
  </code></pre>
  
  <p>How do I go about doing this?</p>
  
  <p>Also, would changing the size of the image change these values?</p>