File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes converting from jpg to png problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "converting from jpg to png problem" Watch "converting from jpg to png problem" New topic
Author

converting from jpg to png problem

Mike Kao
Greenhorn

Joined: Aug 18, 2003
Posts: 4
Hi,
Does anybody know how to make the png file smaller? I used the following code to convert a jpg file to a png file but the problem is that the png file turned out to be much bigger than the origianl jpg file. Any idea of this? Thanks a lot.
-------------------
try{
File f = new File("pic1.jpg");
BufferedImage bi = ImageIO.read(f);
File outfile = new File("pic2.png");
ImageIO.write(bi, "png", outfile);
System.out.println("Converting is successful");
}catch(IOException e){
System.out.println("Converting is failed");
}
--------------------
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: converting from jpg to png problem
 
Similar Threads
ImageIO.write() with "JPG" doesn't work
converting problem from jpg to png.
Size of jar file to upload
Output image file and displaying it on screen
GNU PG Decrypting