我怎样才能改变GIF文件的速度

How can i change the speed of GIF file

    public class Main {
    public static void main(String[] args) throws MalformedURLException {
        URL url= new URL("<file path>");
        Icon icon= new ImageIcon(url);
        JLabel label= new JLabel(icon);

        JFrame mainFrame = new JFrame("Test");
        mainFrame.getContentPane().add(label);
        mainFrame.setSize(800, 600);
        mainFrame.setVisible(true);
        mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainFrame.setResizable(false);
    }
}

如何更改 Gif 文件的速度? 我试图找到如何改变 JFrame 框架的速度,但我没有找到任何东西

你不能。您所能做的就是根据您当前的 gif 创建另一个 gif。为此使用 ImageMagick

检测当前速度:

identify -verbose your.gif | grep Delay

Delay: 5x100
...

创建一个新的 gif:

convert -delay 10x100 your.gif your_slow.gif