forked from: forked from: Optimized PNGEncoder with filters

