
Signature
Knute Johnson
email s/nospam/knute/
> > Is anyone aware of any freeware transcoder plugins which would work in
> > ImageIO? I would like to convert GIFs to another format, such as JPG or PNG
> > but I'd rather not spend time re-inventing the wheel, especially if I can
> > find the wheel free somewhere :-)
>
> I believe that ImageIO will read GIF files but not write them.
Yes, I know that. That's why I'm looking for a transcoder; a transcoder will
take a GIF and rewrite it in a *different* format. For example, a GIF to PNG
transcoder will convert a GIF to a PNG file.
Rhino
Andrew Thompson - 31 Oct 2005 03:40 GMT
(As we all know, Java does not *write* gif's..)
> ..That's why I'm looking for a transcoder; a transcoder will
> take a GIF and rewrite it in a *different* format. For example, a GIF to PNG
> transcoder will convert a GIF to a PNG file.
I think some of the sources on Marco Schmidt's site will
do the trick in core Java, you just need to specify PNG or
JPG for the output..
<http://schmidt.devlib.org/java/image-file-code-examples.html>
HTH
Knute Johnson - 31 Oct 2005 06:44 GMT
>>>Is anyone aware of any freeware transcoder plugins which would work in
>>>ImageIO? I would like to convert GIFs to another format, such as JPG or
[quoted text clipped - 14 lines]
>
> Rhino
Use ImageIO to read the GIF and use ImageIO to write it back out as a
PNG or JPG.
import java.awt.image.*;
import java.io.*;
import javax.imageio.*;
public class test3 {
public static void main(String[] args) throws Exception {
BufferedImage image = ImageIO.read(new File("button0.gif"));
ImageIO.write(image,"PNG",new File("button0.png"));
ImageIO.write(image,"JPG",new File("button0.jpg"));
}
}

Signature
Knute Johnson
email s/nospam/knute/