title: Compress PNG files in PHP
body: <p>I am generating PNG file with cairo extension of PHP. The image contains a background and a text. Now I want to compress these images by PHP after its generated by cairo. Is there any library to do this? </p>
  
  <p>I found <em>pngcrush</em> tool. But its a command line tool. I dont want to invoke <code>system</code> call. If there is not PHP solution a C solution would do. In that case I'll make a PHP extension. </p>
  
  <p>I have read <a href="https://stackoverflow.com/questions/7462827/phpimagick-png-compression">this related</a> question. But there is no answer in it. </p>