title: Interpreting cv2.imencode result
body: <p>What is buffer returned by <code>cv2.imencode</code> represent?</p>
  
  <p>Here is example for 1x1 pix image.</p>
  
  <pre><code>import cv2
  impor numpy as np
  
  img= np.zeros((1,1,3),np.uint8)
  en= cv2.imencode('.jpg',img)
  print type(en)
  &lt;type 'tuple'&gt;
  print en[1].shape
  (631, 1)
  </code></pre>
  
  <p>For some reason size of buffer not changed when the size of image changed:</p>
  
  <pre><code>img= np.zeros((10,10,3),np.uint8)
  en= cv2.imencode('.jpg',img)
  en[1].shape
  (631, 1)
  </code></pre>
  
  <p>Update: it's have different size for bigger image.</p>
  
  <pre><code>img= np.zeros((1000,1000,3),np.uint8)
  en= cv2.imencode('.jpg',img)
  en[1].shape
  (16503, 1)
  </code></pre>
  
  <p>With random data:</p>
  
  <pre><code>img= (np.random.rand(1,1,3)*255).astype(np.uint8)
  en= cv2.imencode('.jpg',img)
  en[1].shape
  (634, 1)
  
  img= (np.random.rand(10,10,3)*255).astype(np.uint8)
  en= cv2.imencode('.jpg',img)
  en[1].shape
  (899, 1)
  
  img= (np.random.rand(1000,1000,3)*255).astype(np.uint8)
  en= cv2.imencode('.jpg',img)
  en[1].shape
  (1175962, 1)
  </code></pre>