Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Image loses quality when loaded in Java

843807Apr 18 2006 — edited Apr 19 2006
Images seem to lose quality when you load them in Java. Try this out to see what I mean... test_out.jpg is smaller than test_in.jpg
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

public class ImageTest
{
    public static void main (String args [])
    {
        BufferedImage img = ImageIO.read (new File ("test_in.jpg"));
        ImageIO.write (img, "JPG", new File ("test_out.jpg"));
    }
}
Is there any way around this? I need to manipulate the image in Java, so I can't just input and output the bytes of the file.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 17 2006
Added on Apr 18 2006
5 comments
612 views