title: Extract image's width, height, color and type from byte array
body: <p>I have an image in the format of <code>byte[]</code> array in my Java code. I want the following information extracted from that array. How can I do it as fast as possible.</p>
  
  <ul>
  <li>Width</li>
  <li>Height</li>
  <li>Color (black &amp; white, color or transparent? If color, what is the main color?)</li>
  <li>Type (Is the image PNG, GIF, JPEG, etc.)</li>
  </ul>