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 / October 2005

Tip: Looking for answers? Try searching our database.

GIF Transcoders for ImageIO?

Thread view: 
Rhino - 29 Oct 2005 17:04 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 PNG
but I'd rather not spend time re-inventing the wheel, especially if I can
find the wheel free somewhere :-)

Signature

Rhino

Knute Johnson - 30 Oct 2005 06:46 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 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.

Signature

Knute Johnson
email s/nospam/knute/

Rhino - 30 Oct 2005 14:22 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 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/



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



©2009 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.