-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
if you find it hard to install node-canvas try ncc #4
Comments
what's ncc? |
There is a readme: https://github.com/indus/ncc/blob/master/README.md |
ah, duh. i'm on the ncc repo. i didn't catch that since i was bouncing around the node-canvas issues. |
Cool project! Skimmed the documentation quickly and it seems like the API isn't strictly compatible though? Since you need a few extra call to actually send the stuff back and forth over the websocket; or did I miss anything? |
@LinusU No it isn't 100% compatible. NCC always gives you funtion back that you have to call to actually do something. But this additional function call sould be the only big difference. |
Have you measured performance compared to node-canvas? |
No - but basic canvas operations should take the same time as if you run them in your browser. Only "syncing" between node and the browser gives some overhead (especially if you want to get back a giant image: base64-encoding and transfering over websocket takes some time). So it really depends on the situation. |
I think the main benefit is not performance but easy setup on windows and 100% pixel-precise results in comparison to the browser (because a browser is doing the work ;-) |
If you have a very special case and don´t need a general canvas API you may be better of using https://bestof.js.org/projects/puppeteer and implement it using the ncc comunication as a concept. |
This doesn't work on a headless system which is why anyone wants to run canvas in the first place. I don't see what ncc solves for. |
Also, for anyone having troubles installing node-canvas, I would recommend using the prebuilt binaries which can be fetched by using the package npm install --save canvas-prebuilt const Canvas = require('canvas-prebuilt') |
@setpixel it works headless. |
a lot of issues in node-canvas deal with installation problems:
Automattic/node-canvas#919
Automattic/node-canvas#913
Automattic/node-canvas#911
Automattic/node-canvas#905
Automattic/node-canvas#901
Automattic/node-canvas#890
Automattic/node-canvas#871
Automattic/node-canvas#854
Automattic/node-canvas#852
Automattic/node-canvas#796
Automattic/node-canvas#788
Automattic/node-canvas#779
Automattic/node-canvas#771
Automattic/node-canvas#768
Automattic/node-canvas#755
Automattic/node-canvas#752
Automattic/node-canvas#751
Automattic/node-canvas#745
Automattic/node-canvas#731
With ncc you just need an installation of chrome(-ium) on your system and everything should be fine.
The text was updated successfully, but these errors were encountered: