title: imagemagick convert png 16 bit to raw
body: <p>I'm trying to convert a 16 bit greyscale PNG to a raw file. The image size is 640*480.</p>
  
  <p>First, identify:</p>
  
  <pre><code>$ identify image.png 
  image.png PNG 640x480 640x480+0+0 16-bit PseudoClass 65536c 299KB 0.000u 0:00.000
  </code></pre>
  
  <p>I'm expecting the result file to be 640*480*2 bytes in size.</p>
  
  <p>Attempt 1:</p>
  
  <pre><code>$ convert image.png -depth 16 image.raw
  </code></pre>
  
  <p>This gives a file size of 330805 bytes. Its first 16 bytes look like:</p>
  
  <pre><code>0x00000000: 89504E47 0D0A1A0A 0000000D 49484452     .PNG........IHDR
  </code></pre>
  
  <p>Attempt 2:</p>
  
  <pre><code>$ convert image.png -depth 16 image.rgb
  </code></pre>
  
  <p>This gives a file size of 1843200 bytes, which is 640*480*2*3.</p>
  
  <p>I'm running imagemagick version 6.7.7-10 on Ubuntu 14.04.</p>
  
  <p>Any ideas?</p>