Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Adjust the quality of JPEG encoding when saving images in JDK 1.4.2

Reply
Thread Tools

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

 
 
MCP
Guest
Posts: n/a
 
      07-02-2003
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)
 
Reply With Quote
 
 
 
 
Marco Schmidt
Guest
Posts: n/a
 
      07-03-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reducing quality of jpeg preview in raw images Sachin Garg Digital Photography 2 02-25-2010 12:37 AM
Firefox Memory Problem viewing and saving Images (jpeg, png) goonmunster Firefox 1 02-12-2005 01:47 AM
Firefox Memory Problem viewing and saving Images (jpeg, png) goonmunster Firefox 0 02-11-2005 04:19 PM
Help with converting IDS from JDK 1.1 to JDK 1.4 Babar Java 1 05-20-2004 09:11 PM
JPEG Questions: Loss In Quality When "Saving" Xtx99 Digital Photography 14 04-13-2004 03:09 PM



Advertisments