Skip to main content

Writing animated GIFs with Java 6

4 replies [Last post]
pjmlp
Offline
Joined: 2003-06-12

Hi,

according to the Java's 6 documentation it is possible to write animated images just using the SDK without any external libraries.

However I'm finding it difficult to do so, since I'm quite a newbie to ImageIO framework.

The documentation seems to be lacking of examples of how to do it properly.

I did search the forum, but only managed to find a few entries related to JAI that I would rather avoid.

Can someone provide a few tips of how to do it?

Thanks in advance,
Paulo

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
robert engels

You need to write each frame using ImageIO.writeToSequence().

You also need to modify the metadata for the frame rate, etc.

see http://java.sun.com/javase/6/docs/api/javax/imageio/package-
summary.html#gif_plugin_notes

On Jun 17, 2007, at 6:00 AM, jai-imageio@javadesktop.org wrote:

> Hi,
>
> according to the Java's 6 documentation it is possible to write
> animated images just using the SDK without any external libraries.
>
> However I'm finding it difficult to do so, since I'm quite a newbie
> to ImageIO framework.
>
> The documentation seems to be lacking of examples of how to do it
> properly.
>
> I did search the forum, but only managed to find a few entries
> related to JAI that I would rather avoid.
>
> Can someone provide a few tips of how to do it?
>
> Thanks in advance,
> Paulo
> [Message sent by forum member 'pjmlp' (pjmlp)]
>
> http://forums.java.net/jive/thread.jspa?messageID=222603
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
> For additional commands, e-mail: interest-help@jai-
> imageio.dev.java.net
>

[att1.html]

pjmlp
Offline
Joined: 2003-06-12

Thanks for your help.

I already have something working that satisfies my original purpose.

As soon as I have it an a release state I'll publish here the link to it.

Cheers,
Paulo

bpb
Offline
Joined: 2004-06-23

Thanks, it's always helpful to see the outcome.

By the way, posts specific to Java Image I/O in Java SE should be posted to java-imageio-interest@java.sun.com. This forum and mailing list are for JAI Image I/O Tools.

> Thanks for your help.
>
> I already have something working that satisfies my
> original purpose.
>
> As soon as I have it an a release state I'll publish
> here the link to it.
>
> Cheers,
> Paulo

pjmlp
Offline
Joined: 2003-06-12

It has taken more time than expected due to work and private life reasons.

However I'm managed to put out a small Swing utility that does just what I need. Check it out at the following url

http://www.progtools.org/graphics/projects/animgen/animgen.html

Cheers,
Paulo