aspose file tools*
The moose likes Performance and the fly likes How to reduce size of ImageIcon object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "How to reduce size of ImageIcon object" Watch "How to reduce size of ImageIcon object" New topic
Author

How to reduce size of ImageIcon object

naved momin
Ranch Hand

Joined: Jul 03, 2011
Posts: 692

I m transporting desktop snapshot image via serializing ImageIcon object over the network using http, this method is quite fast in localhost environment but when i need to transport it over the network i get a delay of 3 sec..i.e if i open notepad.exe at server then client receives that image after 3 sec...
so my main problem here is ..how can i reduce the size of imageicon object ..currently its near to 4MB
I have tried using gzipinputstream & equivalent outputstream but gzipinputstream blocks my thread ...i was chainning like this
do any one knows any API which will allow me to compress my ImageIcon object


The Only way to learn is ...........do!
Visit my blog http://inaved-momin.blogspot.com/
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7674
    
  19

naved momin wrote:do any one knows any API which will allow me to compress my ImageIcon object

Simple answer: no.

However, I'm pretty certain that desktop images are saved as bitmaps, so what might work is to convert them to a lo-res JPEG first and then create your ImageIcon from that. If ImageIcon keeps a copy of the original image, that might significantly reduce its footprint.

Beyond that, I have no expertise in this area.

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to reduce size of ImageIcon object