Extract frame of gif with graphicsmagick in node.js

后端 未结 1 441
梦毁少年i
梦毁少年i 2021-01-06 02:09

I am trying to convert a gif into a png using graphicsmagick on node.js. In their documentation they have the following code:

// pull out the first frame of          


        
相关标签:
1条回答
  • 2021-01-06 02:59

    According to the source you can use .selectFrame(0).

    gm(streamOrBuffer)
        .selectFrame(0)
        .write('/path/to/firstframe.png', function(err) {
            if (err) console.log(err);
        });
    
    0 讨论(0)
提交回复
热议问题