Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I generate image with Nodejs

I've made dynamic image generate service like this https://dummyimage.com/ by PHP. now I'm thinking of make a dynamic image generator with nodejs. but it's not as easy as thought. what kind of module can I use for dynamic image generate?

like image 620
superjang Avatar asked Dec 27 '17 08:12

superjang


People also ask

Is Nodejs good for image processing?

With image processing, your application can resize and compress all the user-uploaded images, which can significantly improve your application performance and save your server disk space. Node. js has an ecosystem of libraries you can use to process images, such as sharp, jimp, and gm module.

Does Nodejs have canvas?

node-canvas. node-canvas is a Cairo-backed Canvas implementation for Node. js.

What is docker in Nodejs?

Docker allows you to package an application with its environment and all of its dependencies into a "box", called a container. Usually, a container consists of an application running in a stripped-to-basics version of a Linux operating system.


2 Answers

you may use this node module for generating random images. https://www.npmjs.com/package/js-image-generator

like image 164
itsrajon Avatar answered Sep 18 '22 21:09

itsrajon


Another possibility is to use the pureimage package which is a pure JavaScript implementation of the HTML Canvas 2D API for NodeJS. It has no native dependencies.

like image 22
Marcus Avatar answered Sep 20 '22 21:09

Marcus