Use php-pngquant without composer including the class in your document.

If you don't use Composer, you can anyway use this wrapper. Get a copy of the PNGQuant.php class from the Github repository and include it in your project.

To use the wrapper, just include the class in your code using require_once:

<?php

require_once('PNGQuant.php');

$instance = new PNGQuant();

And that's it !