Animated gif frame count & fps

How do I find out details of an animated gif? I need to know the number of images in a strip, and also the frame rate. I would like to convert the strip to a BufferedImage for animation.

See http://www.fmsware.com/stuff/gif.html for a free decoder.
It will give you a frame count, and return each frame as a BufferedImage. It will also tell you the duration of each frame (animated GIF's don't have a fixed frame rate).
-- Kevin

Similar Messages

  • Animated GIF frame loss

    I have an applet that has a JPanel with a JLabel in it. That JLabel was created with an ImageIcon constructor with an animated gif image. The gif has eleven frames (each with replace set) and is set to loop. When I bring up the applet the image animates through the first 7 frames then stops. I can File/Open the gif in Netscape and it looks fine - animates all images and loops. Looking at it with:
    setDebugGraphicsOptions(DebugGraphics.BUFFERED_OPTION); or FLASH_OPTION
    it looks good until that 7th frame then I start to see flash of grey the size of the JLabel.
    I understand that the ImageObserver defaults to the JLabel. But I have tried directly setting it with no joy. I have also tried calling .flush() on the image with no joy. So I tried a different animated gif and it stopped on the 3rd frame (but also appears fine in a browser).
    I am on day 2 of trying to figure this out (pulling my hair out).
    I cut this down quite a bit, so there may be syntax errors.
    public class RRR extends JApplet implements RRRConsts
    public void init()
    loadImages();
    myJPanel = new MyJPanel();
    contentPane.add(myJPael);
    private void loadImages()
    try
    problemImage = loadImage(new URL(getDocumentBase(),
    "problem.gif"));
    catch (Exception e)
    { logger.log(Level.SEVERE, "Unable to load images", e); }
    private Image loadImage(URL url) throws InterruptedException
    Image image = getImage(url);
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(image, 0);
    tracker.waitForID(0);
    return image;
    MyJPanel myJPanel = null;
    static Image problemImage = null;
    class MyJPanel extends JPanel implements RRRConsts
    MyJPanel()
    setLayout(null);
    setBounds(0,0,468,540);
    setOpaque(false);
    buildUI();
    private void buildUI()
    myLabel = new MyLabel();
    add(myLabel);
    private MyLabel myLabel = null;
    class MyLabel extends JLabel implements RRRConsts, ActionListener
    MyLabel()
    super(new ImageIcon(RRR.problemImage));
    }

    I just had the same problem. It seems that when using an animated gif as ImageIcon it will not be loaded compeltly if it is too large. The maximum seems to be somewhere between 60 - 70 KB.
    I managed to use a higher compression on my gifs to make them smaller, but I haven't found any general solution yet.

  • Rewinding animated gif frame

    I need a way to be able to play back or rewind an animated
    gif. Is this possible with lingo?

    I just had the same problem. It seems that when using an animated gif as ImageIcon it will not be loaded compeltly if it is too large. The maximum seems to be somewhere between 60 - 70 KB.
    I managed to use a higher compression on my gifs to make them smaller, but I haven't found any general solution yet.

  • How to save GIF frames into BufferedImage with TYPE_BYTE_INDEXED?

    Hi All,
    I have a code that saves every animated GIF frame into BufferedImage of TYPE_INT_ARGB. So an animated GIF will correspond to a list of images with 32-bit pixel size.
    I mainly refer to the code in
    http://forum.java.sun.com/thread.jspa?forumID=20&threadID=629277
    But what I need to do now is to store each frame into TYPE_BYTE_INDEXED image instead. What I'm doing is I get the IndexColorModel from the first frame, and that color model will be shared for all frames.
    As for the frames, I've been trying several ways:
    *1.* read it per usual into 32-bit pixel size image
    sourceImage        = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
    RenderedImage renderedImg = reader.readAsRenderedImage(index, null);*reader is the ImageReader for the GIF file.
    then trying to convert the image into 8-bit pixel size by creating new destination image
    BufferedImage destImage = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_INDEXED, ICM);and then draw the original (32-bit pixel size) onto the newly created image.
    Graphics2D g = destImage.createGraphics();
    g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC));
    g.drawImage(sourceImage, imageLeft, imageTop, null);*2.* read it as:
    BufferedImage sourceImage = reader.read(index);then create new 8-bit image and draw the source onto it as No. 1.
    The problem is, for No. 1 , the destination image always lose its transparency. And No. 2 only works well with some GIFs. But mostly the destination image will lose the transparency as well.
    I hope someone more familiar with java imaging can help point out to me where did I do wrong...
    I'm thinking maybe the way I draw the source onto the destination. Or maybe there's another way of getting GIF frames into TYPE_BYTE_INDEXED images..
    Thank you in advanced :)
    Edited by: irma_k on Dec 12, 2007 8:42 PM

    I found that java has weird issues with GIF's (ImageIO wont even write transparency to GIFs when writing to a file).
    But PNGs seemed to work a lot better. Not sure if it will fix your problem, as I don't know all that much about java imaging, but using PNGs seemed to work a lot better for me when I needed to draw transparency.

  • Open and edit animated .gif while preserving frame timing

    CS4 Premium Design Edition, Win XP
    I was disappointed with the removal of Image Ready from CS3 because although some of the functionality was placed into Photoshop 10, there was no way to open and edit an existing animated .gif while preserving the timing of each individual frame. I was told on the PS forum at the time that I really needed to use Fireworks. I resented that, because I was very happy with Image Ready and I didn't want to have to learn a new application just to gain functionality that had been included in previous versions of PS/IM.
    I've now got CS4 Premium Design Edition which of course includs Fireworks... and here's what Help has to say on the subject of imported .gifs.
    "Note: When you import an animated GIF, the state delay setting defaults to 0.07 seconds. If necessary, use the States panel to restore the original timing."
    This is no use to me. What if I don't know the individual frame timings? What if there are 200 frames with varying timings?
    Simple question: which current Adobe product is capable of importing a .gif while retaining the frame timings? If anyone knows, or if I've misunderstood the nature of the Fireworks Help quote above, I'd really appreciate some input here. Thanks :)
    Not so simple question: why was an excellent gif-editing application thrown out to have its functionality partially replaced by a bunch of scripts and half-effective workarounds cooked up by desperate users ("import a gif by using the video import and typing *.* into the filename box..")? It's a fair question I think.
    Mark

    Hi Bob, that's not glib at all, it's a reasonable question.
    I uninstalled it along with everything else when I installed CS3, in the reasonable expectation that whatever replaced IR would be at least equal in functionality.
    Perhaps I should just dig out CS2 and install IM from there, but I have some serious reservations about doing so, because I don't know if/how a partial install of CS2 will impact upon my installation of CS4, and I'm not confident of getting support.
    I am also curious to know if/why Adobe actually removed basic functionality without replicating or replacing it in their other software. I really want to know: which recent, currently supported Adobe product
    should I be using in order to regain this functionality? Or do Adobe no longer produce a geniuinely comprehensive .gif-editing application?
    Mark

  • Animated GIF ignoring frame timing

    I am trying to create simple animated GIFs with a few layers
    of text that simply fade in and fade out in sequence. My initial
    attempt worked perfectly. Most frames use the default 7/100's of a
    second delay as they fade. A few frames were manually set to much
    longer delays so that the text pauses, before fading out to be
    replaced by the next text.
    When I reopened the file, to adjust the background color, and
    then re-saved it, the GIF now plays straight through, ignoring the
    timing of each frame. Nothing I do now can get it to pause on the
    appropriate frames. I've tried cutting the symbols out and pasting
    them into a new file, removing the animation from the symbols and
    reapplying it, etc.
    Any ideas, anyone?
    Thanks in advance.

    None, None.

  • I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different p

    I am trying to create a simple animated gif in Photoshop. I've set up my frames and want to use the tween to make the transitions less jerky. When I tween between frame 1 and frame 2 the object in frame two goes out of position, appearing in a different place than where it is on frame 2. Confused!

    Hi Melissa - thanks for your interest. Here's the first frame, the second frame and the tween frame. I don't understand why the tween is changing the position of the object in frame 2, was expecting it to just fade from one frame to the next.

  • Animated GIF not cycling frames in Tomcat

    I have pages that use animated gif files to get across a point.
    In the IDE, they cycle the images as they should
    SunAppserver cycles them properly.
    I only get the first frame in Tomcat (5.5.7)
    Over on the java.net, I saw this on a page concerning JAI:
    GIF
    The decoder supports animated GIF files and GIF files with transparent background. Only the first frame of an animated GIF file may be loaded via JAI; subsequent frames must be obtained via direct use of the ancillary codec classes.
    Um, am I missing something, or is this a Tomcat problem ?

    You just need transparency in your file. Not sure if it has to be pre-multiplied. In graphic converter you need to remove the backgrounds. Haven't used GC in years so can't say how you can be sure it's gone but in Photoshop, Illustrator and After Effects you can choose to have a checkerboard background to tell you when you are seeing 'thru' the image and by how much (the overall opacity or mask of the whole image if that doesn't confuse the issue).
    If you are using PS images they will almost certainly generated with a set of rectangles including a perimeter cropping box and white background and these need to go either before it's bitmapped in a vector base app or the relevant pixels erased after it has been bit mapped in GC. As previously mentioned, if you have a unique bkgd colour, colour selecting/keying are some ways to do this). Much faster for >10 images to generate the plots without the bkgd but this may not be possible, what software is source material coming from?
    I regularly bring in vector based moving art-work into keynote with alpha from Adobe AE, Apple Quartz and rendered .mov files. Some codecs (H.264) don't support a separate alpha channel (RGBA) but PNG (slow to render) and animation and a bunch of others do. Pre-multiplying removes the A channel in the RGBA (by multiplying the R/G/B by the A values) thereby speeding and making compatible with some GPUs/render pipelines.

  • Animated Gif - Save for web not showing full frame range

    Hey,
    I'm trying to export an animated gif with 52 frames - I'm using the timeline in CS6, it's exported correctly in the past but when I try and save for web only a seemingly arbitrary number of rames appear in the animation. With no clear route to rectify this, I've tried to affect the outcome by simply moving things around on the timeline.
    I've had a variety of frame ranges (and frames) numbering between 2 and 6 frames, far off my 52 target. It's a simple image and equally simple transition to keep filesize down but I'm completely bamboozled by this. It looks like a bug but any advice I could get would be much appreciated.

    If it worked in the past with CS6 try resetting your CS6 Photoshop Preferences.  If you still have the problem after that.  Up load the PSD file to a server and post a link to it.

  • Animated Gif - Problem with Frame Delay

    Mac OS X 10.5.8 
    PSE 6.0
    I just created an animated gif by following the steps in PSE Help.  It says that I should be able to adjust the rate at which the images rotate by changing the Frame Delay measurement but I am unable to change it.  In fact I am unable to change anything in the Animation section of the dialog box. 
    When I check Animation, the options appear to become active (they're no longer greyed out) but I can neither uncheck the Loop option nor change the Frame Delay option.  All other sections of the dialog box work fine.
    Your help would be most appreciated!
    Beth

    Unfortunately this is broken in PSE 6 and PSE 8. You can tab into the frame delay box if you start above it someplace on that side of the screen, and it appears to let you change the rate, but your choice doesn't really affect the actual frame rate. The only workaround is to duplicate frame layers that you want to stay onscreen longer (so it will be changing just as fast, but not visibly).

  • Stepping an animated gif, one frame at a time?

    Does anyone know how to do this?
    I want my own timer to tell it when to paint the next frame.
    What I really want is an "asynchronous progress indicator", in other words, an icon that animates as long as stuff is still making progress.

    Does anyone know how to do this?
    I want my own timer to tell it when to paint the next
    frame.
    What I really want is an "asynchronous progress
    indicator", in other words, an icon that animates as
    long as stuff is still making progress.You can easily manipulate animated GIF images with Gif4J PRO for Java (http://www.gif4j.com/java-gif-imaging-gif4j-pro-library.htm)
    For example you can decode GIFs using Java Decoder (http://www.gif4j.com/java-gif4j-pro-gif-image-load-decode.htm) and then modify delays between frames or even extract frames and animate them manually.

  • Animated GIF - Fastest frame rate?

    I am trying to create a sort of lightning effect and would like to flip through three or four frames super quickly (for the flash effect).
    Problem is that in my animation settings, even if i set the frame duration to 1/100, the frames still show for like half a second each. Really does NOT come off like a lightning strike...
    Is there some sort of trick to making the frames flip faster?
    Or maybe a limitation on animated GIFs that I am not aware of?
    On a side note, would Flash be a better tool for animated GIFs?

    Are you using photographs in the animation? Is the animation large (what are its dimensions)? If yes. it could be the complexity of the image causing the delay. The more complex the image, the longer it takes the browser to render it. GIF animations should be small and the imaes it contains posterlike vector images. Flash might be the best program to use for your animation.

  • Problem to create animated gif using transparent frames

    Hi, everyone:
    My name is Edison, I am playing with Gif89Encoder utility classes to make an animated gif which is a requirement for my course work.
    I got some problem about the transparent frames. I used the png image as the frame to create the animated gif,
    those pngs have transparent colors and the background is totally transparent, when i create the animated the gif with those
    frames, the animated gif display the colors but without transparency for those colors, but the background is transparent as expected.
    I am not sure if I should IndexGif89Frame or DirectGif89Frame for the colors from the Gif89encoder package.
    Is there anyone got the same problem and knows how to fix it?
    The following is how i setup the colors in my png file, the alpha channel is 80.
    Color[] colours = new Color[7];
              colours[0] = new Color(255, 255, 255, 0);
              colours[1] = new Color(128, 128, 255, 80);
              colours[2] = new Color(128, 0, 128, 80);
              colours[3] = new Color(0, 128, 128, 80);
              colours[4] = new Color(128, 128, 0, 80);
              colours[5] = new Color(204,102,255,80);
              colours[6] = new Color(255, 0, 0, 80);The code i did to generate gif:
    public void run89Gif()
            Image[] images = new Image[4];    
            try{
                images[0] = ImageIO.read(new File("D:/temp/0.png"));
                images[1] = ImageIO.read(new File("D:/temp/1.png"));
                images[2] = ImageIO.read(new File("D:/temp/2.png"));
                images[3] = ImageIO.read(new File("D:/temp/3.png"));
                OutputStream out = new FileOutputStream("D:/temp/output.gif");
                writeAnimatedGIF(images,"Empty annotation", true, 1, out);         
                images = null;
            }catch(IOException er){ }
    static void writeAnimatedGIF(
            Image[] still_images,
                String annotation,
                boolean looped,
                double frames_per_second,
                OutputStream out) throws IOException
            Gif89Encoder gifenc = new Gif89Encoder();
            for (int i = 0; i < still_images.length; ++i){
               gifenc.addFrame(still_images);
    gifenc.setComments(annotation);
    gifenc.setLoopCount(looped ? 0 : 1);
    gifenc.setUniformDelay((int) Math.round(100 / frames_per_second));
    gifenc.encode(out);
    Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hi, everyone:
    My name is Edison, I am playing with Gif89Encoder utility classes to make an animated gif which is a requirement for my course work.
    I got some problem about the transparent frames. I used the png image as the frame to create the animated gif,
    those pngs have transparent colors and the background is totally transparent, when i create the animated the gif with those
    frames, the animated gif display the colors but without transparency for those colors, but the background is transparent as expected.
    I am not sure if I should IndexGif89Frame or DirectGif89Frame for the colors from the Gif89encoder package.
    Is there anyone got the same problem and knows how to fix it?
    The following is how i setup the colors in my png file, the alpha channel is 80.
    Color[] colours = new Color[7];
              colours[0] = new Color(255, 255, 255, 0);
              colours[1] = new Color(128, 128, 255, 80);
              colours[2] = new Color(128, 0, 128, 80);
              colours[3] = new Color(0, 128, 128, 80);
              colours[4] = new Color(128, 128, 0, 80);
              colours[5] = new Color(204,102,255,80);
              colours[6] = new Color(255, 0, 0, 80);The code i did to generate gif:
    public void run89Gif()
            Image[] images = new Image[4];    
            try{
                images[0] = ImageIO.read(new File("D:/temp/0.png"));
                images[1] = ImageIO.read(new File("D:/temp/1.png"));
                images[2] = ImageIO.read(new File("D:/temp/2.png"));
                images[3] = ImageIO.read(new File("D:/temp/3.png"));
                OutputStream out = new FileOutputStream("D:/temp/output.gif");
                writeAnimatedGIF(images,"Empty annotation", true, 1, out);         
                images = null;
            }catch(IOException er){ }
    static void writeAnimatedGIF(
            Image[] still_images,
                String annotation,
                boolean looped,
                double frames_per_second,
                OutputStream out) throws IOException
            Gif89Encoder gifenc = new Gif89Encoder();
            for (int i = 0; i < still_images.length; ++i){
               gifenc.addFrame(still_images);
    gifenc.setComments(annotation);
    gifenc.setLoopCount(looped ? 0 : 1);
    gifenc.setUniformDelay((int) Math.round(100 / frames_per_second));
    gifenc.encode(out);
    Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Photoshop CS5, animated gif, how to add url to 1 frame.

    I have created an animated gif in Photoshop CS5 and want to embed a url to one of the 3 frames.
    How do I do this?
    I've read that I can use the slice tool to do this (?), but if so, I need help in laymans language as to how to do this.
    The animated gif is for a website on a wordpress platform. When this particular frame is clicked, it should link to the url which I want to add.
    Please help!
    Thank you.

    Whoops, sorry put this in the lightroom forum by mistake. Will post it in the PS CS5.

  • Can't set frame rate on animated GIF PSE8 on Mac

    When saving an animated GIF in Elements 8 (running on Mac OSX 10.6 Snow Leopard) I can't modify the frame rate. It is set at the default .2 delay and can't be modified. Anyone know of a fix for this?
    Thanks.

    Thanks Barbara... I have used that very workaround already - but was hoping there was a solution so I could just do it in the app designed for this! So unfortunate that Adobe knows about this bug and hasn't fixed it!

Maybe you are looking for

  • I can't boot my MBP or reinstall snow leopard

    I have an old 2005 MBP (non unibody) using snow leopard. I urgently need to get it running again since it stopped booting up last feb 2012 and I haven't used it since as I'm using a desktop now. When I turn it on I get no chime and the screen goes gr

  • Need some graphics card advice for using 3D and Adobe

    Below are the specs for the workstation I just bought. I'm planning on upgrading the graphics card to a GeForce GTX 570 (Fermi) 1280MB. The chassis is pretty small, and I'm concerned that it might get too hot. Does anyone have any advice as to whethe

  • XD Transfer Quiting Unexpectedly

    I am running FCP 6.03 and am trying to import some xd cam footage in to fcp using xdcam transfer. The footage was shot on the EX1. About 50 percent of my media will not import in to fcp from xdcam transfer. The software just quits and gives me a mess

  • Best Practices for Maintaining SSAS Projects

    We started using SSAS recently and we maintain we one project to deploy to both DEV and PROD instances by changing the deployment properties. However, this gets messy when we introduce new fact tables in to DEV data warehouse (that are not promoted t

  • Open Hub Third Party

    Hi Gurus, 1. I am creating an Open hub destination as Third Party. mentioning my RFC destination as my SRM system RFC Name. but my question is where this file will be saved in my destination system. What is the physical path name? Thanks in advance.