title: How to use PNG's IDAT chunk?
body: <p>I'm trying to understand how data are stored into IDAT chunk. I'm writing a little PHP class and I can retrieve most of chunks information but what I get for IDAT doesn't match pixels of my image :</p>
  
  <p><img src="https://i.stack.imgur.com/UkEdc.png" alt="enter image description here"> It is 2×2px truecolour with alpha (bitdepth 8).</p>
  
  <p>But when I interpret IDAT data like this:</p>
  
  <pre><code>current(unpack('H*',gzuncompress($idat_data)));
  </code></pre>
  
  <p>I get</p>
  
  <blockquote>
    <p>00000000ffffff00ffffff000000</p>
  </blockquote>
  
  <p>I don't understand how it can match pixels. Or is it my code which corrupts data?</p>
  
  <p>Thanks for your help!</p>
  
  <p>EDIT: I get</p>
  
  <blockquote>
    <p>08d705c101010000008010ff4f1750a93029e405fb</p>
  </blockquote>
  
  <p>as hex compressed data, so it seems I loss several bytes after uncompressing.</p>
  
  <p><img src="https://i.stack.imgur.com/Fci4V.png" alt="enter image description here"></p>