A while back I used a PNG optimisation service called (I think) \"smush it\". You fed it a weblink and it returned a zip of all the PNG images with their filesizes nicely, w
Have you heard of PNGCrush? You could check out the source, part of PNG and MNG Tools at SourceForge, and transcribe or wrap it in Python.