private static final Logger LOGGER = Logging.getLogger(PNGJWriter.class);
public RenderedImage writePNG(RenderedImage image, OutputStream outStream, float quality,
WMSMapContent mapContent) {
// what kind of scaline filtering are we going to use?
FilterType filterType = getFilterType(mapContent);
// Creation of a new PNGWriter object
PNGWriter writer = new PNGWriter();
// Check if a Scanline is supported by the writer
boolean isScanlineSupported = writer.isScanlineSupported(image);
// If it is not supported, then the image is rescaled to bytes