title: How to convert bitmap 16-bit RGBA4444 to 16-bit Grayscale in C++?
body: <p>I used method:</p>
  
  <pre><code>val = 0.299 * R + 0.587 * G + 0.114 * B;
  image.setRGBA(val, val, val, 0);
  </code></pre>
  
  <p>to convert bitmap (24-bit RGB888 and 32-bit RGBA8888) to grayscale successfully.</p>
  
  <p><code>Example: BMP 24-bit: 0E 0F EF (BGR) --&gt; 51 51 51 (Grayscale) // using above method</code></p>
  
  <p>But can't apply for bitmap 16-bit RGBA4444.</p>
  
  <p><code>Example: BMP 16-bit: 'A7 36' (BGRA) --&gt; 'CE 39' (Grayscale)  // ???</code></p>
  
  <p>Anyone know how?</p>