Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Image content compression

Reply
Thread Tools

Image content compression

 
 
Kannan
Guest
Posts: n/a
 
      11-14-2005
Hi,
Does someone know of any java api's libraries for image compression. I
am not looking for compression into zip. For example a gif file is much
smaller than a jpg file (this is because some information about editing
the page is lost in gif file).

Basically the image file is available as a byte stream (InputStream). I
want to compress the bytes and store image into a database. The image
will be only read from db and noone will be editing the image (which
means that it is okay to loose editing information while compression).

Are there any APIs for this?

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      11-14-2005
Kannan wrote:

> Does someone know of any java api's libraries for image compression. I
> am not looking for compression into zip. For example a gif file is much
> smaller than a jpg file


Not always, no. A GIF made from a JPEG with high
compression can actually trun out larger.

>..(this is because some information about editing
> the page is lost in gif file).


GIF format only supports 256 colors.

> Basically the image file is available as a byte stream (InputStream). I
> want to compress the bytes and store image into a database. The image
> will be only read from db and noone will be editing the image (which
> means that it is okay to loose editing information while compression).
>
> Are there any APIs for this?


You can use the javax.imageio.ImageIO class to write the
image as JPEG or PNG format, but core Java (until 1.6)
does not support writing GIF's. You will require a
third-party API/source for writing GIF's pre 1.6.

HTH
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error: Only Content controls are allowed directly in a content page that contains Content controls. hazz ASP .Net 6 06-09-2010 01:54 PM
Image size problem. Image Compression =?Utf-8?B?UGFyYWtp?= ASP .Net 1 06-24-2005 11:55 AM
Need Image (Object) to text compression??? Alex Zorin Java 3 08-23-2004 07:46 PM
Best Image -- Image Size vs Compression john chapman Digital Photography 5 08-09-2004 01:21 PM
Image compression William Ortenberg ASP .Net 4 07-21-2004 03:41 PM



Advertisments