Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Image content compression

Thread view: 
Kannan - 14 Nov 2005 08:59 GMT
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?
Andrew Thompson - 14 Nov 2005 11:07 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.