title: Serializing image stream using protobuf
body: <p>I have two programs in Ubuntu: a C++ program (TORCS game) and a python program. The C++ program always generates images. I want to transfer these real-time images into python(maybe the numpy.ndarray format). So I think that maybe using Google protobuf to serialize the image to string and send string to python client by ZMQ is a feasible method.</p>
  
  <p><strong>Question</strong>: which value type is suitable for the image(a pointer) in <code>.proto</code> file?  In another words, which value type I should use to replace <code>string</code> type in the below example?</p>
  
  <pre><code>message my_image{
       repeated string image = 1
       }
  </code></pre>
  
  <p>This is the way I write image to memory (uint8_t* image_data):</p>
  
  <pre><code>glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, (GLvoid*)image_data);
  </code></pre>
  
  <p>At last, maybe there is a better way to transfer image (in the memory) to a python client?</p>
  
  <p>Any suggestions are appreciated.</p>