Png optimization

This is a work-in-progress, but please try it out and let me know if it makes your PNGs faster while consuming less memory.