Questions tagged [node-canvas]

Node canvas is a Cairo backed Canvas implementation for NodeJS.

Installation

$ npm install canvas

node-canvas extends the canvas API to provide interfacing with node, for example streaming PNG data, converting to a Buffer instance, etc. Among the interfacing API, in some cases the drawing API has been extended for SSJS image manipulation / creation usage, however keep in mind these additions may fail to render properly within browsers.

Github

Node Wiki

152 questions
0
votes
1 answer

Node.js javascript-barcode-reader gives null on scanning image

I am working on reading multiple barcodes, from uploaded images in node.js. For that I am using javascript-barcode-reader, which needs ImageData as input. to get ImageData of an image, I had to make use of node-canvas (as I have to do it all in…
0
votes
0 answers

Scale image width and height according to a number

I have a certain amount of squares with the width and height of 40, Is there any way to fit them "perfectly" into an image generated with node-canvas without the image being too big or too small? Also making the image size balanced so that there is…
xBeastMode
  • 29
  • 1
  • 7
0
votes
0 answers

node-canvas layers replacement

I have this image, that is white, but there is some black text on it (and a square), and I want to replace the white with another image. How do I do this in node-canvas? I checked out the documentation but there isn't a layer feature, so how can I…
Mxm
  • 97
  • 1
  • 13
0
votes
1 answer

nodejs base64 image response is not coming as image object. when adding header {'Content-Type': 'image/jpeg or png'}

When I am generating image on the server side & getting base64 image string. Which I want to send as image object. It is working properly with node-canvas by creating image stream. let stream = this.canvas.jpegStream({progressive: true}); …
Sumeet Roy
  • 140
  • 12
0
votes
1 answer

TypeError occurs when calling toDataURL after image filter applied

Version fabricjs 2.0.0-beta.6 node-canvas 1.6.6 nodejs 6.11.0 Steps to reproduce fabricjs on nodejs, 1.7.16 works fine with image filter, when update to 2.0.0, can't get it work var jsonStr =…
Adam Lyu
  • 11
  • 2
0
votes
1 answer

Add font to node-canvas

I've been trying for the past hour to add font to my image unsuccessfully. Unfortunately while this may seem like a really easy thing to do I cant get it to work. const Canvas = require('canvas'); var Font = Canvas.Font; var BerlinSansFBRegular =…
nonerth
  • 549
  • 2
  • 7
  • 19
0
votes
1 answer

Extract rgba data from image

I am looking for a way to extract all the rgba data of an image. I came across the getImageData() method from the module canvas and for a 10x10 in my case it returns an array only with zero. Below is how I extract the data right now. Any ideas,…
worer
  • 103
  • 2
  • 11
0
votes
1 answer

How to overlay unicode characters on image with node-canvas?

I'm trying to overlay unicode characters on an image, but the characters are not showing. var img = new Image() img.src = fs.readFileSync(path.join(__dirname, 'images', 'snow.jpg')) ctx.drawImage(img, 0, 0, 500, 500) img = new Image() …
user796870
  • 81
  • 2
  • 8
0
votes
1 answer

npm ERR! Failed at the canvas@1.4.0 install script 'node-gyp rebuild

I am trying to deploy my app to digitalocean with dokku. Even if I have ssh'ed to digitalocean machine and ran a command to install all dependencies as is stated in wiki (sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev…
kaytrance
  • 2,657
  • 4
  • 30
  • 49
0
votes
0 answers

Generate images on asp.net server using fabricjs

I've been using FabricJS for some time now, have a panel which creates a template using FabricJS, saving this template in json format on server side. At run time I want to generate image files of saved template that is content of json file will be…
Jack
  • 197
  • 1
  • 21
0
votes
1 answer

fabric on nodeJS, No images rendering at all

The issue is on Ubuntu 14.04: NodeJS: 0.10.32 Canvas: 1.3.6 Fabric: 1.6.0-rc.1 Example JSON: { "objects": [{ "id": 0, "name": "1452525510_death_star.svg", "type": "image", "originX": "left", "originY": "top", "left": 78, …
dudzio1222
  • 44
  • 4
0
votes
0 answers

How to get font name to pass to canvas

I would like to know how to get a name of the font I installed to pass to HTML5 canvas context to set the font. I am using node-canvas, and trying to set a font to unleanred. After downloading and installing the font, I tried this to set the…
mc9
  • 6,121
  • 13
  • 49
  • 87
0
votes
2 answers

Node.js stream.on('end'... does not make file readable

I try to catch the completion of writing the canvas stream thusly: var out = fs.createWriteStream(out_fs); var stream = canvas.createPNGStream({ bufsize: 2048 }); stream.on('end', function () { // can we use out_fs now?…
metalaureate
  • 7,572
  • 9
  • 54
  • 93
0
votes
1 answer

Node-Canvas Cairo build errors

I am getting errors installing cairo on OSX from source. I am following this guide: https://github.com/Automattic/node-canvas/wiki/Installation---OSX. I can't find any reference to "x86_64-apple-darwin14.0.0-pkg-config: File exists" on google…
N.Hale
  • 1
0
votes
1 answer

Node.js canvas module on windows 7(32 bits)

I am unable to install the canvas module on nodejs.I found the errors shown in the attached image.enter link description here http://inkfi.com/error-images/error.pngClick to see full image
Shivang Gupta
  • 3,139
  • 1
  • 25
  • 24
1 2 3
10
11