newtykip / canvas-gif

🖼️ Manipulate GIFs easily using node-canvas!
Other
22 stars 7 forks source link

API docs? #9

Closed dcsan closed 1 year ago

dcsan commented 2 years ago

seems like an interesting project but can you let me know what features you support?

I'd like to overlay some images and text onto an animated GIF (eg memegenerator) is that possible?

newtykip commented 2 years ago

Something like that definitely is possible, with v1 and the upcoming v2! The current version just provides access to an instance of node-canvas for each frame, and v2 will offer a similar API while dropping node-canvas as a dependency for significant speed increases and a more fluent API!

newtykip commented 2 years ago

Oh yeah, also documentation will be coming alongside V2 - I just didn't see much need for in-depth documentation for V1 due to the fact it is a single function project

dcsan commented 2 years ago

Thanks for the quikc reply! OK interesting. are you moving to sharp?

i found node-canvas is a bit more tricky to install - on an M1 mac at least.

SVG support would be nice too, i have that working with sharp now, even for embedded images https://github.com/lovell/sharp/issues/2844#issuecomment-1107917103

But i had problems with most of those npm plugins for GIF stuff and ended up making just a batch tool since CLI imagemagick is pretty reliable. https://github.com/dcsan/pixtools/blob/main/tools/composite.sh

interested to see how you're going to make it work!

GitHub
pixtools/composite.sh at main · dcsan/pixtools
Contribute to dcsan/pixtools development by creating an account on GitHub.
newtykip commented 2 years ago

Yeah, the next update should mark a complete transition to sharp! Just running a little behind where I want to be right now because of how much exams are piling on right now (and sadly this will be the case for a hot second :/)

Also yeah, I've had a lot of problems with node gif tools - that's why I'm trying to outsource as much of it as I can to lightweight, well maintained projects liek sharp and potentially gm in the future, just so it has polish and is as fast as I can possibly make it. I may try and make my own optimisations later down the line, but for now this will be a massive improvement anyways!