If the benefit is to use the drawing API in a Node context outside of a server environment, that makes more sense to me.
If the benefit is to use the drawing API in a Node context outside of a server environment, that makes more sense to me.
We had an application where a canvas-based editor was used to create diagrams, and then these diagrams were saved to a library. We wanted to have each saved diagram to have a preview image to better visually distinguish between them while scrolling. The ability to render a png on the server from the canvas would have saved us a lot of trouble.
15 years ago I was driving GD and ImageMagick from PHP to render things like staff ID cards, barcode labels for things, etc.
It was trivial to write a script that would render something quickly and just output raw image data, so you could <img src="whatever.php?name=Joe&department=Meat" /> and the image would be dynamically created and sent with the right MIME type.
Plenty of great use cases for this.
It could start with something simple like tic-tac-toe and only two players. A player would tell the app a number between 1 and 9 corresponding to the place he/she chose. Then the server/bot would send the updated image to the conversation.
What do you think? :)
As such, the backend would do the heavy lifting of rendering the board, and send the rendered board back into the message group.
Of course one might be able to use emoji or text as a representation of said state if the game allows for it.
It was so much easier to build the animation in canvas for the site and just replay it to get frames for a video on the server than to try to make the video in some other environment and then show it in the browser.
There are plenty of reasons to want to generate an image dynamically on a server. Dynamic image resizing to fit client requirements is one that immediately comes to mind.
This would be really useful for similar modern projects.
However I also needed to implement a server-side version of it that prerendered all the cards to PNG so that they're browsable without having clients consume excessive cpu/battery. Doing it using a separate codebase would have been hell to reconcile. Hence node-canvas.
* visitors counter
* request IP
* game stats in forum signature (implemented this with gd and ruby)