something like PNG.makeFromRgbaData(width,height,arrayRGBA); and it will return a PNG instance from your pre-existing data. I was about to try to implement it myself.. but I was confused about how the buffer was set up in your code.
The usecase is for the typical PNG data with 8 bits channels for r,g,b and alpha (wich is what people use 99.99 percent of the time I would assume.