add writePNG method for BlitBuffer