Changing speed of moving gif

I currently have some java code that displays a moving gif file i.e. a gif file that has several images in it that are shown in a timed sequence and can give the illusion that the picture is moving if animated correctly.
Anyway I use
logo1 = new ImageIcon("magic.gif" );
to get the image and latter use a method that displays it.
My question is basically I was wondering if there is any other method I can use to slow the gif file down.
Otherwise I am going to have to edit the gif image itself by using some image manipulation software which I currently don�t have.
Any idea if this is possible.
Thanks

import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.FileImageInputStream;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
* @author Ian Schneider
public class AnimatedGIF {
    public static void main(String[] args) throws Exception {
        ImageIcon icon = new ImageIcon();
        javax.swing.JFrame f = new javax.swing.JFrame();
        f.setDefaultCloseOperation(f.EXIT_ON_CLOSE);
        f.getContentPane().add(new JLabel(icon));
        f.setVisible(true);
        ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next();
        reader.setInput(new FileImageInputStream(new File(args[0])));
        for (int i = 0; i < reader.getNumImages(true); i++) {
            BufferedImage image = reader.read(i);
            icon.setImage(image);
            f.pack();
            f.repaint();
            try {
                Thread.sleep(100);
            } catch (InterruptedException ioe) {
        System.exit(0);
}

Similar Messages

  • PSE 9 - cannot change speed of animated GIF

    I read in other discussions that there was a 'bug' on Mac version of previous releases of PSE and the the speed of the animated gif couldn't be set.
    I also read that this was fixed in PSE 9, but it doesn't work for me.
    What is the real status of this bug ? Could it be that 'old' files were retained when I installed PSE 9 and that they override the 'good' ones ?
    (I erased all visible traces of PSE 8 from my Application support folders, prefs folders, etc.. , but didn't run the proper desinstall tool and now it dooesn't work - hangs after a while)
    Thanks for help on this

    It was fixed and got broken again, so it is currently broken, unfortunately. PSE 9 is pretty poor for animated gifs in many ways, including inability to see all the layers in an existing gif, so it's best just to avoid using it for this, I'm afraid.

  • Drawing moving GIF images?

    Is it possible to draw moving gif images on a simple Frame applet?
    I made an image drawer class for my applet and i can draw simple 2d images.
    Here is the basis of my GameSprite class;
        public byte[] pixels;
        public int width;
        public int height;
        public GameSprite(String imageName, int requestIndex) {
         try {
                    // Removed code, it's zipInputStream, but it can be used just as ./image.jpg etc
         javax.swing.ImageIcon icon = new javax.swing.ImageIcon(fileBytes);
         width = icon.getIconWidth();
                     height = icon.getIconHeight();
                     pixels = fileBytes;
         } catch(Exception e) {
              e.printStackTrace();
        public void drawSprite(int x, int y) {
         try {
              Image image = Toolkit.getDefaultToolkit().createImage(pixels);
                                    //Removed code here
              graphics.drawImage(image, x, y + 7, width, height, observer);
         } catch(Exception e) {
              e.printStackTrace();
        }If i try to draw an animated gif image it dosn't move.
    Thanks for any help.

    In Java you need to override the paint method in AWT and paintComponenet method in SWING to do graphics/animation. If you go to an offscreen rendering, then you can paint to the graphics context of an image you use for a drawImage in your paint/paintComponent...
    If you where overriding a Panel in AWT you would override paint:
    public void paint(Graphics g){
      g.drawImage(im, 0, 0, this);
    }Then where you are maipulating your graphics you would do something like this:
    //code snippet
    Graphics g = im.getGraphics();
    //make what ever changes to im by manipulating the graphics context g
    repaint();

  • Moving GIF images

    Hi
    Earler I had Golive and could make moving GIF images in a timeline. Can ayone tell me how it works in Dreamweaver CS4?
    ...from the beginning..
    Sten, Boras, Sweden

    In Java you need to override the paint method in AWT and paintComponenet method in SWING to do graphics/animation. If you go to an offscreen rendering, then you can paint to the graphics context of an image you use for a drawImage in your paint/paintComponent...
    If you where overriding a Panel in AWT you would override paint:
    public void paint(Graphics g){
      g.drawImage(im, 0, 0, this);
    }Then where you are maipulating your graphics you would do something like this:
    //code snippet
    Graphics g = im.getGraphics();
    //make what ever changes to im by manipulating the graphics context g
    repaint();

  • K9a2 plat. v2. unable to change speed on my case fan

    Hi!
    I just bough a 80mm case fan and I can't change it's speed using the BIOS or from within the OS using speedfan.
    The fan in question is a Zalman ZM-F1 with a 3 pin connector.
    The motherboard can detect the fan speed. (3000rpm, so it's registering it correctly) but I have so far been unable to change it's speed. I can't figure out why, since i have a 120mm no-name fan which it detects changes speed just fine.
    The 120mm is connected to sysfan 1 (works)
    The 80mm zm-f1 is connected to sysfan2 (doesn't work)
    I know that I can use a connector to the psu to perma-run the fan in silent mode, but the thing is that i want to be able to control the fan from BIOS (and OS). I can't figure out why i cant control the speed since the bios is able to detect it  Could this be a BIOS issue?
    I've been trying to find something about this issue for myself but this is all i've managed to come up with so far :
    In this link it's mentioned that some motherboards can't monitor the fan speeds. I'm however able to see the fan speed.. so why can't it be changed?  hmm..
    http://www.quietpcusa.com/Zalman-80mm-Quiet-Computer-Fan-with-3-Pin-Connector-ZM-F1-P73C6.aspx
    I hope that some of you might be able to shed some light over the situation. I'm at a loss here.
    Best wishes
    /Cawanga
    K9A2 PLATINUM V2
    BIOS ver. 1.5
    AMD Phenom 9750 2640MHZ@220 FSB
    Corsair 2x2048-6400
    ATI 3850 CF
    Corsair 740w PSU
    Maxtor 6L300S0 300GB, Western Digital WD2000JD 200 GB, Samsung HD103UJ 1TB
    Lite-On LTR-48246S CDRW, NEC ND-3500AG DVDRW
    Win XP Pro 32-bit SP3

    As you can see in BIOS (H/W Monitor) the only Fan Header that allows fan regulation is SYSFan1. I am afraid there is not much you can do besides:
    Quote
    I know that I can use a connector to the psu to perma-run the fan in silent mode,

  • How to change Speed?

    Hi,
    I'm using 2960 with GLC-GE-100FX= .
    I can not change Speed from Auto to 100MB.
    Please advice how to change Speed.  
    Current I/F setting is as following,
    Switch#sh int gi 0/1
    GigabitEthernet0/1 is down, line protocol is down (notconnect)
      Hardware is Gigabit Ethernet, address is 0025.b42a.d919 (bia 0025.b42a.d919)
      MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
         reliability 255/255, txload 1/255, rxload 1/255
      Encapsulation ARPA, loopback not set
      Keepalive not set
      Full-duplex, Auto-speed, link type is auto, media type is 100BaseFX SFP
      input flow-control is off, output flow-control is unsupported
      ARP type: ARPA, ARP Timeout 04:00:00
      Last input never, output never, output hang never
      Last clearing of "show interface" counters never
      Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
      Queueing strategy: fifo
    Best regards,
    Ichiro

    Hi Leolaohoo,
    Thank you for your prompt reply and exact answer.
    I connected Fiber optic cable to SFP.  Speed became 100Mb/s from Auto automatically.   Thanks!
    Best regards,
    Ichiro

  • Problem to change speed of my plan

    Hello,
    when i want to change speed of my plan, it's impossible because there's an error at the time of trim operation.
    What can i do to solve this problem.
    Thank you
    Sof Gasiglia

    See if this helps
    http://www.fcpbook.com/Video7.html

  • Any way to change speed of a clip in "over-write edit" mode?

    I want to change the speed of a clip in the timeline without having to lock all the other tracks or having to move the other following clips out of sync. For example I have a clip which lasts for 1 sec, which I want to change to 3 secs. Normally when I do this in the timeline the other clips on the same video tracks which follows, will move their position..... How to change speed in "over-write edit mode"?

    I think it's even easier to just match frame the "source file"... put your playhead on the clip you want to speed change in your sequence. Then type optioncmdf. Perform the speed change in the Viewer, then simply cut it in... Might help to put it up above the older, use the double arrow selection tool facing right to move the clips past this change later... pull the upper track speed changed clip down over the old, and viola.
    Gotta say though, it's a lot easier to perform the speed change in the Viewer, and edit it all in as you go rather than doing it after you've put the clip in a sequence. (not always possible to determine what the speed change should be maybe, but sure easier.... FCP 7 handles this problem a lot better for sure, and worth the upgrade price if your machine is compatible.
    Jerry

  • Podcast how to change speed from 1.5x to 1x speed without having to go through 2x, 3x etc?

    Podcast how to change speed from 1.5x to 1x speed without having to go through 2x, 3x etc?

    Whereas I need to be
    able to go from disc 1/track 1 to disc 1/track 2,
    instead the iPod goes from disc 1/track 1 to disc
    2/track 1.
    Right click on any of these files and do a Get Info. Notice that there is, in fact, a Disc number field. So you can make disc numbers 1/10, 2/10 and so on.
    iTunes and the iPod are both smart enough to recognize that there are disc numbers there and act correctly. So it'll start with Disc 1, play all that disc, then go to Disc 2, and so forth. It's just a matter of having correct disc number tags.
    You can tag disc numbers for a whole disc at once. Simply select all the songs in a single disc (hold SHIFT or CTRL while selecting the songs), right click, Get Info, and you get the mass tag editor screen. Add the disc number info for this disc, and it'll tag that info to all those songs. Repeat for each disc.

  • Best way to change speed of clips

    Hey, I want to change speed of clips, both faster and slower in one clip. What is the best way to do that preserving the quality? I am still learning FCP so my apologies, and I had a hard time finding anything on here through search.

    Jerry's right...
    Take a look at this:
    http://homepage.mac.com/captmench/SlowMo3.mov
    Two frames each of FCP and Shake at 50%. Use your arrow keys to go frame by frame. First frame is normal, second is interpolated. Look at the background!!
    Creative cow should have the whole tutorial online soon... I'll post back with the link when they do.
    Also, for time remap -- shake's got that under control too... but for now, look at this:
    http://www.proapptips.com/proapptipsvideotutorials/879F6B61-CFF9-4FD1-8D43-FDF89 605611A/D95A1854-BE2C-46A6-A064-FA0A2306E254.html
    Good luck,
    CaptM

  • Way to change speed of entire Project easily?

    Hi, I know how to change the speed of an individual clip in the timeline - but is there an easy way to change the entire speed of the project? Thanks.

    Hi, thanks guys - that worked - although it seems when I change the speed of the nested sequence and export it the quality is quite a bit worse (exporting it with the same settings) - seems to be a lot of jagged edges now. Is there something in the 'Change Speed' window that should be changed? I am creating a sequence and doubling the speed and another sequence exported with 4 times the speed. What is checked in the Change Speed window is 'Frame Blending' and 'Scale Attributes' (the default settings). Any ideas how to get rid of the 'jaggedness' that is being created? (this file was originally a .dv file - a regular export to quicktime from regular speed sequence looks fine. Thanks.

  • Firefox 5 does not remember changed speed tweaks. Every time I close the browser they revert to the standard setting..what gives!

    Firefox 5 does not remember changed speed tweaks. Every time I close the browser they revert to the standard setting..what gives!'''bold text'''
    '''Moderator note: Locked as dupe of [https://support.mozilla.com/en-US/questions/843444 843444] --T'''

    Now up to Firefox 8 and the problem persists. Cannot go to the www.turnitin.com page and login as I used to do -- Firefox does not remember my username or password.
    Still works on Windows, and with other browsers... It would be great if a fix is available.

  • Quickest way to change speed but not clip duration

    I'm trying to determine the fastest method for changing the speed
    of a clip already in the timeline, but not the clips duration. Primarily, slowing a clip down.
    The best I've come up with so far is to put the timeline playhead over the
    clip and hit X to get the clips IN and OUT points placed in the timeline. Then,
    drag the clip into the Browser, effectively making a copy of it there. Then bring the clip into the Viewer, then hit APPLE J to bring up the speed change window, affect the change, then overwrite the change you've made in the viewer back down into the timeline where you placed the original IN and OUTS. Seems like alot of step.
    Is there a faster way? Any change I try to make in the timeline itself results
    in a clip duration change. The only other way I've found it to use the time remap tool put that is even more complicated and is alot less exact when trying to make something, say, 50% slower.
    Any input would be appreciated.

    Another, close but not quite there method I've tried is the TIME REMAP tool
    that lives with the SLIP AND SLIDE.
    I can affect speed changes, and see what percentage speed change I'm
    trying to make, but it wants to change speed on both the left and right side
    of the clip. In other words, I can't place the timeline playhead or Time remap tool at the beginning or end of the clip and only effect the speed of the entire
    clip unless there is no clip adjacent to the clip I'm trying to change.
    Otherwise it changes the speed as I want for 99% of the clip and then during
    the last several frames I've accidentally sped up up those frames. I can't position it to just change the speed for the entire clip.

  • Changing Speed of clip in timeline in a specific wqay

    I realize there are a variety of ways of affecting
    a change to the speed of a clip already in the timeline,
    but I'm trying to figure out how to do it in one very specific way:
    If I have 3 clips (A,B,C) and I want to change the speed
    of B so that it is slower, but not expand the clip from
    it's original length (meaning it will still occupy the
    same spot, duration and length in the timeline), is there a way of accomplishing that just by punching a specific figure
    in somewhere (i.e. make it move at 50%).
    I know about fit-to-fill, time remap, right clicking a clip
    and changing speed. However, I don't want the clip to
    expand past it's spot in the timeline, just play slower in the spot it occupies.
    The closest I've come is going into the time remap tool and lowering the end keyframe so it moves slower, but this is
    imprecise. I want to be able to punch in 50%, or 60% somewhere and have it take, without expanding. The time remap tool won't let me punch in 50%, although that indicator moves when I drop the ending keyframe down a little.
    Can what I'm describing be done, and if so, how? Thanks.

    Match frame back to the original media. Slow it down, then cut it back in.
    You cannot slow down the clip in the timeline without it expanding. You are telling FCP to take the existing clip and make it longer...of course it will expand in size. It doesn't know that you don't want it to do that. It assumes (rightly so) that you want the clip, with the IN and OUT points you designated, to be slower. Keeping it in the same spot on the timeline means cutting off the head or tail of the clip...losing points you told FCP you wanted.
    Simple to just load the clip into the viewer, slow it down to the speed you want, then cut it in.
    Shane

  • Trouble shooting changing speed

    Not able to change speed in Final cut express.  Telling me there was a problem during a trim operation.  Anyone run across this?  Thanks

    This can happen when the speed change moves the content of the timeline and tracks, usually the audio tracks, collide. There are various ways around this. You can use the F key to match frame to the browser clip, apply the speed change to that, and edit it into the timeline. With the playhead at the start of the clip you can press Cmd-Opt-F to call up a new copy of the clip from the hard drive, apply the speed change there, and then end into the timeline. The last way some people use is to drag the clip to the end of the timeline, apply the speed change there, and then move back into the timeline however you like.

Maybe you are looking for