Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   BMP to GIF convertion (http://www.velocityreviews.com/forums/t126023-bmp-to-gif-convertion.html)

Hiranya Samarasekera 08-26-2003 06:07 AM

BMP to GIF convertion
 
Hi all,

I'm in the process of writing a BMP to GIF converter.. Can anyone suggest me
a good BMP to GIF conversion library.

Does the ACME package have this feature?

thanks in advance,
Hiranya



Marco Schmidt 08-26-2003 12:16 PM

Re: BMP to GIF convertion
 
Hiranya Samarasekera:

>I'm in the process of writing a BMP to GIF converter.. Can anyone suggest me
>a good BMP to GIF conversion library.
>
>Does the ACME package have this feature?


ACME has a GIF encoder. Simply combine a BMP decoder with a GIF
encoder. Here is a list with both such tools:
<http://www.geocities.com/marcoschmidt.geo/java-image-coding.html>.
Note that some countries still have a patent on GIF's LZW algorithm:
<http://www.geocities.com/marcoschmidt.geo/gif-image-file-format.html>.

Regards,
Marco
--
Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html

Hiranya Samarasekera 08-27-2003 03:28 AM

Re: BMP to GIF convertion
 
Thanks Marco for the info...

I tried to read a JPEG file and to convert it into GIF format, usin the ACME
encorder. But it throws up an exception saying that there are too much
colors for a GIF. This happens even if i use a JPEG with 2 colors.

Does anyone know the reason for this?

Thanks,
Hiranya

*****************

"Marco Schmidt" <marcoschmidt@geocities.com> wrote in message
news:2qjmkvsgqtv4oom1fuv3seaet2c9oqeuep@4ax.com...
> Hiranya Samarasekera:
>
> >I'm in the process of writing a BMP to GIF converter.. Can anyone suggest

me
> >a good BMP to GIF conversion library.
> >
> >Does the ACME package have this feature?

>
> ACME has a GIF encoder. Simply combine a BMP decoder with a GIF
> encoder. Here is a list with both such tools:
> <http://www.geocities.com/marcoschmidt.geo/java-image-coding.html>.
> Note that some countries still have a patent on GIF's LZW algorithm:
> <http://www.geocities.com/marcoschmidt.geo/gif-image-file-format.html>.
>
> Regards,
> Marco
> --
> Please reply in the newsgroup, not by email!
> Java programming tips: http://jiu.sourceforge.net/javatips.html
> Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html




Marco Schmidt 08-27-2003 03:06 PM

Re: BMP to GIF convertion
 
Hiranya Samarasekera:

>I tried to read a JPEG file and to convert it into GIF format, usin the ACME
>encorder. But it throws up an exception saying that there are too much
>colors for a GIF. This happens even if i use a JPEG with 2 colors.
>
>Does anyone know the reason for this?


Well, there are too many colors in the input image. :) GIF only
supports up to 256 different colors in an image. Your average JPEG
photo has a lot more. ACME then simply gives up.

BTW, I doubt that the JPEG really has only two colors. Even if you
compressed a two-color-image as JPEG, there may be more colors after
compression because of the way JPEG works. And JPEG is suitable only
for photos with a lot of different colors, so saving a two color image
as JPEG is a bad idea. That's why conversion between JPEG and GIF
rarely is a good idea. They are designed for different types of
images.

Anyway, the solution for your problem is using some sort of color
reduction. Some GIF encoders at
<http://www.geocities.com/marcoschmidt.geo/java-image-coding.html>
have this built-in, search for "color image quantization". And think
again if you really must convert those JPEGs to GIF.

Regards,
Marco
--
Please reply in the newsgroup, not by email!
Java programming tips: http://jiu.sourceforge.net/javatips.html
Other Java pages: http://www.geocities.com/marcoschmidt.geo/java.html


All times are GMT. The time now is 12:15 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.