benjaminadk / gif-encoder-2

Encode GIFs with Node
The Unlicense
58 stars 18 forks source link

Getting canvas from electron #4

Open rastographics opened 4 years ago

rastographics commented 4 years ago

@benjaminadk You mention in the readme about getting an instance of canvas right from electron (instead of importing the canvas npm package).

Do you have an example of how to do that? I can't find any examples on the web on how to do this.

benjaminadk commented 4 years ago

@rastographics - I just re-read the readme. So when I cobbled this together I was playing around with a GIF editor/recorder desktop built on top of electron - with a React UI - checkout the encoders here for some examples Electron Examples . You can also use FFMPEG to encode GIFs and it is by far the fastest, if I remember. That file is in there as well. Basically, all I mean by is that within Electron you have access to the Canvas API that, because you have access to the browser. As opposed to a typical Node app where there is no direct access to browser apis. Let me know if you have any questions about the code I linked.