code: public static boolean writeImage(BufferedImage image, String filename,
              int dpi) throws IOException
      {
          return writeImage(image, filename, dpi, 1.0f);
      }
docs: Writes a buffered image to a file using the given image format. See
  {@link #writeImage(BufferedImage image, String formatName,
  OutputStream output, int dpi, float quality)} for more details.
  
  @param image the image to be written
  @param filename used to construct the filename for the individual image.
  Its suffix will be used as the image format.
  @param dpi the resolution in dpi (dots per inch) to be used in metadata
  @return true if the image file was produced, false if there was an error.
  @throws IOException if an I/O error occurs