title: How to save floating-point pixel values in image file
body: <p>I want to save floating-point numbers as pixels in an image file. I am currently working in OpenCV-python, but I had also tried it with Pillow (PIL). Both packages convert <code>float</code> pixel data to integer before writing them to the file.</p>
  
  <p>I want to save pixel values such as:</p>
  
  <pre class="lang-none prettyprint-override"><code>(245.7865, 123.18788, 98.9866)
  </code></pre>
  
  <p>But when I read back the image file I get:</p>
  
  <pre class="lang-none prettyprint-override"><code>(246, 123, 99)
  </code></pre>
  
  <p>Somehow my floating-point numbers get rounded off and converted to integers.
  How to stop PIL or OpenCV from converting them to integer?</p>