code: public void dumpPngImage( String imagePath, ReferencedEnvelope bounds, int imageWidth, int imageHeight, double buffer,
              int[] rgbCheck ) throws IOException {
          BufferedImage dumpImage = drawImageWithNewMapContent(bounds, imageWidth, imageHeight, buffer);
          boolean dumpIt = true;
          if (rgbCheck != null)
              dumpIt = !isAllOfCheckColor(rgbCheck, dumpImage);
          if (dumpIt)
              ImageIO.write(dumpImage, "png", new File(imagePath)); //$NON-NLS-1$
      }
docs: Writes an image of maps drawn to a png file.
  
  @param imagePath the path to which to write the image.
  @param bounds the area of interest.
  @param imageWidth the width of the image to produce.
  @param imageHeight the height of the image to produce.
  @param buffer the buffer to add around the map bounds in map units.
  @param rgbCheck an rgb tripled. If not <code>null</code> and the image generated is
  composed only of that color, then the tile is not generated.
  This can be useful to avoid generation of empty tiles.
  @throws IOException