I put the script with some examples here: http://www.xgarreau.org/aide/devel/gd/libgd3.php
Feel free to comment it ...