title: Unknown image header, what could be causing distortions
body: <p>I am working on decoding an image file derived from an x-ray machine which is of unknown format.</p>
  
  <p>The extension is <strong>.img</strong>, however this does not match any known formats of this extension, nor does the <strong>magic number heading</strong> match any references I've been able to find online (including DICOM specifications).</p>
  
  <p>The data appears to be uncompressed, so I am able to attain an image by simply parsing the bytes after chopping off a randomly sized header (example images are chopped by ~512 bytes).</p>
  
  <p>Here is the funny part - there appear to be two images embedded in every file, neither of which appears to be rendered correctly, as seen below:</p>
  
  <p><a href="http://ogaard.no/out.jpg" rel="nofollow">http://ogaard.no/out.jpg</a></p>
  
  <p>And the original:</p>
  
  <p><a href="http://ogaard.no/in.img" rel="nofollow">http://ogaard.no/in.img</a></p>
  
  <p>I have little experience with image encoding, and after bedding with Google for a couple of days on the subject I have to give in to the greater forces available on the interwebs - hopefully you.</p>
  
  <p>Does anyone know what this kind of distortion indicates or knows about tools for decomposing/analysing image headers/data structure?</p>