#imagemagick #graphicsmagick #gm
Вопрос:
Как получить gif-кадры с помощью node gm?
Пример на PHP
$frames = new Imagick( 'image.gif' )->coalesceImages();
Ответ №1:
https://github.com/aheckmann/gm/issues/512
gm("./image.gif").identify(function (err, val) {
let frames_count = val.Scene.replace(/d* of /, "");
for(let i = 0; i < frames_count; i ) {
let path = `./frame${i}.png`;
this.selectFrame(i).write(path, function () {
console.log(arguments[3]);
});
}
});