Created
September 23, 2016 01:52
-
-
Save ricardolee/64713c64bc935f1b88cd3fe84548c07e to your computer and use it in GitHub Desktop.
Convert PNG to JPEG
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BufferedImage bufferedImage = ImageIO.read(new ByteArrayInputStream(dates)); | |
BufferedImage newBufferedImage = new BufferedImage(bufferedImage.getWidth(), | |
bufferedImage.getHeight(), BufferedImage.TYPE_INT_RGB); | |
newBufferedImage.createGraphics().drawImage(bufferedImage, 0, 0, Color.WHITE, null); | |
ImageIO.write(newBufferedImage, "jpg" , new FileOutputStream(TEST_DIR + "/" + OUTPUT_FILE)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment