Squish images using pngquant, then pngout, with a perceptual difference check at the end.  All wrapped up in a Platypus droppable mac app, but the basic script is just a shell script.