Adjust the quality of JPEG encoding when saving images in JDK 1.4.2
It's easy to save a BufferedImage the following way :
BufferedImage image = ...
File file = new File("picture.jpg");
ImageIO.write(image, "jpg", file);
But how do you adjust the quality of the JPEG encoding ? (in JDK 1.4.2)
Re: Adjust the quality of JPEG encoding when saving images in JDK 1.4.2
>But how do you adjust the quality of the JPEG encoding ? (in JDK 1.4.2)
Use a (JPEG)ImageWriteParam object and call its setCompressionQuality
method. Here's code:
Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html
|All times are GMT. The time now is 03:11 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.