Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Adjust the quality of JPEG encoding when saving images in JDK 1.4.2 (http://www.velocityreviews.com/forums/t123968-adjust-the-quality-of-jpeg-encoding-when-saving-images-in-jdk-1-4-2-a.html)

MCP 07-02-2003 02:11 PM

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)

Marco Schmidt 07-03-2003 08:33 AM

Re: Adjust the quality of JPEG encoding when saving images in JDK 1.4.2
 
MCP:

[...]

>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:
<http://javaalmanac.com/egs/javax.imageio/JpegWrite.html>.

Regards,
Marco
--
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 05:44 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.