code: public static void saveImage(Image image, OutputStream os, String imgFileFormat){
  		BufferedImage bImg = null;
  		if(image instanceof BufferedImage){
  			bImg = (BufferedImage) image;
  		} else {
  			bImg = BufferedImageFactory.getINT_ARGB(image);
  		}
  		
  		if(isFormatRGBOnly(imgFileFormat) && bImg.getType() != BufferedImage.TYPE_INT_RGB){
  			image = BufferedImageFactory.get(image, BufferedImage.TYPE_INT_RGB);
  		} else if(imgFileFormat.toLowerCase().equals("wbmp") && bImg.getType() != BufferedImage.TYPE_BYTE_BINARY){
  			image = BufferedImageFactory.get(image, BufferedImage.TYPE_BYTE_BINARY);
  		}
  		try { 
  			boolean success = ImageIO.write(bImg, imgFileFormat, os);
  			if(!success){
  				throw new ImageSaverException("Could not save Image! No appropriate writer was found.");
  			}
  		} catch (IOException e) {
  			throw new ImageSaverException(e);
  		}
  	}
docs: Saves specified Image to file of specified img file format.
  <p>
  Some image file formats may require image type conversion before
  saving. This method converts to type INT_RGB for jpg, jpeg and bmp,
  and to type BYTE_BINARY for wbmp.
  <p>
  The provided {@link OutputStream} will not be closed, this is the
  responsibility of the caller.
  @param image to be saved
  @param os {@link OutputStream} to write image to.
  @param imgFileFormat image file format. Consult {@link #getSaveableImageFileFormats()}
  to get the supported img file formats of your system.
  @throws ImageSaverException if an IOException occured during
  the process or no appropriate writer could be found for specified format.
  @since 1.1