wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes PERFORMANCE problem in ENCODING java.awt.Image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "PERFORMANCE problem in ENCODING java.awt.Image" Watch "PERFORMANCE problem in ENCODING java.awt.Image" New topic
Author

PERFORMANCE problem in ENCODING java.awt.Image

velmurugan
Greenhorn

Joined: Jun 08, 2006
Posts: 24
Hi Friends, We are having a performace problem in encoding java.awt.Image in to any of the PNG or DIB or GIF formats. The problem is the size of the image is more than expected. We are getting 22 kb to 27 kb PNG image. But our requirement is 10 - 11 kb only. Here I am attaching the class file, which is actually doing encoding part. If any one can give valuable suggestion it will be great help to us. Thanq.
[ December 20, 2006: Message edited by: kvel murugan ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41096
    
  44
So is 10-11 KB a size that is reasonably to be expected for the image you have, or do you require an image of that size? Those are two different things.

Have you had a look at the javax.imageio.ImageWriteParam.setCompressionQuality method? It can be used to set the compression level (and hence the quality and size of the resulting file).


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PERFORMANCE problem in ENCODING java.awt.Image
 
Similar Threads
Blurred Image 6630
Image upload
KeyEvent Problem
painting an image
Display png images on applet