196197198199200201202203204205
// encode into PNG PNGDecodeParam decodeParam = new PNGDecodeParam(); decodeParam.setGenerateEncodeParam(true); PNGImageEncoder enc = new PNGImageEncoder(output, decodeParam.getEncodeParam()); enc.encode(image); gr.dispose(); }