Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Question concerning writing image as JPG using imageio

Thread view: 
Trung Chinh Nguyen - 25 Apr 2006 14:38 GMT
Here's the code that I'm using:

Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
ImageWriter writer = (ImageWriter)writers.next();
ImageOutputStream ios = ImageIO.createImageOutputStream(new
File(outputFile));
writer.setOutput(ios);
writer.write(outputImage);

I'm wondering about the quality of the output image (i.e how much data
is lost), and is there a way to change it?
steve - 25 Apr 2006 23:41 GMT
> Here's the code that I'm using:
>
[quoted text clipped - 7 lines]
> I'm wondering about the quality of the output image (i.e how much data
> is lost), and is there a way to change it?

this is java , what do you think?

have a look at:

            JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
               JPEGEncodeParam  param   =
                   encoder.getDefaultJPEGEncodeParam(outImage);

               param.setQuality((float) .9, false);
               encoder.setJPEGEncodeParam(param);
               encoder.encode(outImage);
         
Steve

Signature

NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth

Trung Chinh Nguyen - 26 Apr 2006 10:59 GMT
Thanks for your answer, this is exactly what I'm looking for :)

> this is java , what do you think?
>
[quoted text clipped - 9 lines]
>          
> Steve


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.