This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes converting problem from jpg to png. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "converting problem from jpg to png." Watch "converting problem from jpg to png." New topic
Author

converting problem from jpg to png.

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 problem from jpg to png.
 
Similar Threads
Size of jar file to upload
GNU PG Decrypting
converting from jpg to png problem
ImageIO.write() with "JPG" doesn't work
how to open picture in JPanel