Link to home
Start Free TrialLog in
Avatar of ssolai
ssolai

asked on

convert gif into jpeg

anybody will help me in coding to convert gif file into
jpeg format by using java?
Avatar of Ovi
Ovi

This is what I have :
java1 :
// GifEncoder - write out an image as a GIF


java2 :
// A framework for classes that encode and write out an image in
// a particular file format.

and more.... maybe is what you need
Answer:

1)JavaTM Advanced Imaging API
http://java.sun.com/products/java-media/jai/index.html

2)
make java image from gif file.
and then use JPEG class - http://www.afu.com/jpeg.txt

3)
 15. (Sect. 13) How can I convert between GIF and JPEG formats?

     [*] In a word: don't.
     There's hardly any overlap between the set of images that JPEG works
     well on and the set that GIF works well on. Sometimes, with enough
     care, you can get an acceptable conversion...but most of the time
     GIF<->JPEG conversion will just turn your image to mush. It's better to
     pick the right format in the first place.
     Other sites:
        o If you're determined to convert formats anyway, try the GBM
          (Generalized Bitmap Module). The package is GNU licensed, in C and
          is very good. Find it at
          http://www.interalpha.net/customer/nyangau/
          GBM does a good job converting to JPEG, and 'lossiness' is
          adjustable to 0%. It also converts to/from about 20 other formats,
          does cropping, sizing, color mapping, gamma correction,
          halftoning, everything you could want. GBM source doesn't support
          JPEG directly, but utilizes JPEG source from IJG called jpeg-6a
          and found at
          ftp://sun2.urz.uni-heidelberg.de/pub/simtel/graphics/jpegsr6a.zip
        o For more info see the JPEG FAQ at
          http://www.faqs.org/faqs/jpeg-faq/
Answer in previos comment
Avatar of ssolai

ASKER

l need code not logic
ASKER CERTIFIED SOLUTION
Avatar of vladi21
vladi21

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
compile.bat:

set CLASSPATH=C:\jdk1.2\jai\lib\jai_core.jar;C:\jdk1.2\jre\lib\rt.jar
javac gifToJpeg.java


codec libs inside JDK 1.2...
R u still have questions?
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects the problem and the expert will now receive these points; points verified.

Please click on your Member Profile and select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.  Or if you are an EE Pro user, click the link below to select open items for your Member ID using Power Search:
https://www.experts-exchange.com/jsp/qPowerSearch.jsp.

This is the Community Support link, if help is needed, along with the link to All Topics which reflects many TAs recently added.

https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
https://www.experts-exchange.com/jsp/zonesAll.jsp
 
Thank you,
Moondancer
Moderator @ Experts Exchange