Java BufferedImage Encode encodePNG(BufferedImage image, String pathAndFileName)

Here you can find the source of encodePNG(BufferedImage image, String pathAndFileName)

Description

encode PNG

License

Open Source License

Declaration

public static void encodePNG(BufferedImage image, String pathAndFileName) 

Method Source Code

//package com.java2s;
/*// w  w w  . ja  va  2 s.  c  om
 * $Id: PixelUtil.java,v 1.3 2007/01/29 09:08:46 eiki Exp $ Created on May 29,
 * 2006
 * 
 * Copyright (C) 2006 Idega Software hf. All Rights Reserved.
 * 
 * This software is the proprietary information of Idega hf. Use is subject to
 * license terms.
 */

import java.awt.image.BufferedImage;

import java.io.File;

import javax.imageio.ImageIO;

public class Main {
    public static void encodePNG(BufferedImage image, String pathAndFileName) {
        try {
            ImageIO.write(image, "png", new File(pathAndFileName));
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
    }
}

Related

  1. encodeImage(BufferedImage image)
  2. encodeImage(BufferedImage image)
  3. encodeImageToBase64(BufferedImage image)
  4. encodeImageToPNGByteArray(BufferedImage image)
  5. encodeJPEG(BufferedImage image)
  6. encodeToImgElement(BufferedImage image, String formatName)