title: Is possible to check if a PNG image has transparent background?
body: <p>I'm using a crop &amp; resize function for images, but I need to let it crop/resize ONLY png files WITH transparent backgrounds, at least 1 pixel in the image should be transparent for the image to be accepted.</p>
  
  <p>Is possible to check if a PNG image has transparent background/pixels?</p>
  
  <p>I'm using PHP and GD libraries.</p>
  
  <p>EDIT: Ok, I've figured out how to do this on PHP with GD libraries. Look how clean it looks! :)</p>
  
  <pre><code>&lt;?php
  
  $im = imagecreatefrompng("php.png");
  $rgba = imagecolorat($im,1,1);
  $alpha = ($rgba &amp; 0x7F000000) &gt;&gt; 24;
  
  var_dump($alpha);
  ?&gt;
  </code></pre>
  
  <p>Any ideas how to do an array for the x/y coordenates to check all the image pixels looking for at least 1 pixel = $alpha = 127?</p>