i make a gif canvas with multiple picture, now i want to export it but canvas is not export into gif its only export into png format my code is `
var c_img = new Konva.Image({
image: imageObj,
width: 600,
height: 600,
name: 'rect',
draggable: true,
id: filename,
keepRatio: true,
enabledAnchors: [
'top-left',
'top-right',
'bottom-left',
'bottom-right',
],
});
layer.add(c_img);
var dataURL = document.querySelector('canvas').toDataURL('image/gif');`
Canvas element doesn't support exporting into GIF. You have to use external library for that task. There are many tools available. For the demo, I used gifshot.
Using Konva you can generate frames, by exporting every frame as image. Then use these images as input for gif library.