I was just asked about this from someone that was misled by an answer above.
In the description you have written that you don't want to do compression so all you need to do is call writer.write(image);
and not writer.write(null, image, iwp);
which is trying to compress a png which is a lossless format.