title: raw bitmap to png in QT
body: <p>I have bytearray where every three bytes describes 1 pixel (RGB). The task is to convert it to jpeg or png. I receive the image palette from socket, construct its relevant RGB24 from the RGB table I have. </p>
  
  <p>The problem I have is I cannot convert this bitmap to png now. for example:</p>
  
  <pre><code>image.loadFromData((const char*)bytes);
  qDebug() &lt;&lt; image.save("/home/saman/image.png");
  </code></pre>
  
  <p>if this is not the way, another option is adding png header to the bitmap array. However, I have no idea how to do that. </p>
  
  <p>Anyone has any ideas please?</p>