title: Opencv Different Outputs with imshow and imwrite
body: <p>I read two images into numpy arrays using open cv. I tried two different equations for adding these images</p>
  
  <p>Equation 1:
      img = (img_one/2) + (img_two/2)</p>
  
  <p>Equation 2:
      img = (0.5*img_one) + (0.5*img_two)</p>
  
  <p>Equation 1 outputs image as expected, but Equation 2 outputs an image completely unexpected.</p>
  
  <p>Here's my code (python2):</p>
  
  <pre><code>import numpy as np
  from cv2 import *
  
  tiger = imread('tiger.jpg')
  nature = imread('nature.jpg')
  
  mul_img = 0.5*tiger + 0.5*nature
  div_img = tiger/2 + nature/2
  
  imshow('mul_image', mul_img) 
  imshow('div_image', div_img)
  waitKey(0)
  destroyAllWindows()
  </code></pre>
  
  <p>Original images used:</p>
  
  <p><a href="https://i.stack.imgur.com/zRUNu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zRUNu.jpg" alt="Tiger image"></a></p>
  
  <p><a href="https://i.stack.imgur.com/yUgdg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yUgdg.jpg" alt="enter image description here"></a></p>
  
  <p>The images generated are as follows:</p>
  
  <p><a href="https://i.stack.imgur.com/xqfSu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xqfSu.png" alt="division image"></a></p>
  
  <p><a href="https://i.stack.imgur.com/awLGQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/awLGQ.png" alt="multiplication image"></a></p>