Automattic

Automattic/node-canvas

JavaScript Web Dev

Node canvas is a Cairo backed Canvas implementation for NodeJS.

10.7k stars
1.2k forks
active
GitHub +3 / week

10.7k

Stars

1.2k

Forks

467

Open issues

30

Contributors

v3.2.3 31 Mar 2026

AI Analysis

node-canvas is a Cairo-backed Canvas API implementation for Node.js, enabling server-side image generation and manipulation. It serves developers who need to create, render, or process images programmatically in Node.js environments—particularly useful for backends generating dynamic graphics, PDFs, or thumbnails. Not a general-purpose graphics library; specialized for developers integrating Canvas API into server applications.

Web Dev Library Discovery value: 4/10
Documentation 8/10
Activity 9/10
Community 8/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 7/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

canvas-api image-generation cairo-binding nodejs-native graphics-rendering
Actively maintained Well documented Popular Niche/specialized use case Production ready
Deep Analysis · Based on README and public signals
2w ago

node-canvas brings the browser Canvas API to Node.js via Cairo for server-side image generation

node-canvas implements the HTML5 Canvas API in Node.js backed by the Cairo graphics library, enabling server-side image generation, PDF creation, and SVG rendering without a browser. It is primarily used by backend developers who need to generate charts, thumbnails, dynamic images, or process graphics programmatically. Maintained by Automattic (WordPress.com), it has been a foundational tool in the Node.js ecosystem for over 15 years, with pre-built binaries for major platforms reducing friction significantly.

Origin

Created in September 2010, making it one of the oldest active Node.js native addons. Grew alongside Node.js itself. Moved to Automattic stewardship which brought sustained maintenance through multiple major versions.

Growth

Growth was driven organically by the absence of alternatives for server-side canvas rendering in Node.js. Stars have accumulated steadily over 15+ years rather than through viral moments. The availability of pre-built binaries (since v2.x) removed a major friction point that historically caused installation failures, likely sustaining long-term adoption. Recent star velocity (2 per week) reflects a mature, stable project rather than a growing one.

In production

Widely referenced in Node.js image generation tutorials and Stack Overflow answers. Used as a dependency by chart libraries (e.g., Chart.js server-side rendering), thumbnail generators, and CMS platforms. The npm package 'canvas' has historically ranked among the more downloaded native addon packages. Automattic's direct ownership implies internal production use at WordPress.com scale. Exact download figures not available in the provided metadata, but circumstantial evidence of broad production use is strong.

Code analysis
Architecture

Likely a native Node.js addon (N-API or NAN) that wraps Cairo for 2D rendering. Appears to expose the standard Web Canvas API (CanvasRenderingContext2D) plus Node.js-specific extensions like streaming PNG/JPEG/PDF output. Browser-compatible shim (browser.js) suggests isomorphic usage is supported. Optional dependencies (giflib, librsvg, libjpeg) indicate a modular native build system.

Tests

A passing 'Test' badge is visible in the README, indicating CI-based automated testing exists. The specific coverage percentage is not documented in the README.

Maintenance

Last push was June 21, 2026 — 5 days before evaluation date — indicating active, recent maintenance. Maintained by Automattic, a well-funded company, which reduces abandonment risk. The project has been continuously maintained for 15+ years, which is a strong maturity signal.

Honest verdict

ADOPT IF: you need server-side 2D canvas rendering in Node.js and can tolerate native binary dependencies — this is the de facto standard for this use case with 15 years of stability. AVOID IF: your deployment environment cannot install native modules (e.g., some serverless platforms or restricted containers), or you only need image transformation rather than programmatic drawing. MONITOR IF: you rely on full Web Canvas API spec compliance, as the compatibility wiki notes gaps that may matter for complex browser-ported code.

Independent dimensions

Mainstream potential

4/10

Technical importance

8/10

Adoption evidence

7/10

Risks
  • Native dependency on Cairo, Pango, and related libraries complicates deployment in containerized or serverless environments where system library installation is restricted.
  • Pre-built binaries only cover major platforms; exotic architectures (e.g., Linux ARM musl/Alpine) still require compiling from source, which can fail in CI pipelines with missing system libraries.
  • Web Canvas API compliance is incomplete per the project's own wiki; code that relies on newer or edge-case browser Canvas behaviors may produce different results.
  • Slow star velocity (2/week) and very long maintenance history suggest the project is in a maintenance-mode plateau rather than active feature expansion — new Canvas API additions may lag browser implementations.
  • Dependency on Automattic's continued stewardship introduces concentration risk, though the long track record significantly mitigates this concern.
Prediction

node-canvas will likely remain the standard for Node.js server-side canvas rendering for the foreseeable future, maintained at a steady pace. Mainstream growth is unlikely; its role is well-defined and stable rather than expanding.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

JavaScript
66.7%
C++
30.6%
C
1.6%
Python
0.8%
TypeScript
0.2%
CSS
0.1%
HTML
0%

Information

Language
JavaScript
Last updated
3d ago
Created
192mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

Brooooooklyn

Brooooooklyn/canvas

A high-performance Node.js canvas library that binds Google's Skia graphics...

2.3k Rust Dev Tools
mattdesl

mattdesl/canvas-sketch

canvas-sketch is a framework for creating generative and procedural artwork in...

5.3k JavaScript Web Dev
tdewolff

tdewolff/canvas

Canvas is a Go library for vector graphics rendering that outputs to multiple...

1.8k Go Dev Tools
motion-canvas

motion-canvas/motion-canvas

Motion Canvas is a TypeScript library and editor for creating vector animations...

18.8k TypeScript Media
Developer-Mike

Developer-Mike/obsidian-advanced-canvas

Advanced Canvas is an Obsidian plugin that extends the native canvas feature...

1.4k TypeScript Productivity
vs. alternatives
sharp

sharp focuses on image transformation (resize, crop, format convert) via libvips and is significantly faster for those use cases. node-canvas is more appropriate when you need to draw/compose graphics programmatically using the Canvas API rather than transform existing images.

Jimp

Jimp is pure JavaScript with no native dependencies, making it easier to install, but it lacks the Canvas API surface and is notably slower. node-canvas wins for complex drawing operations; Jimp wins for portability in constrained environments.

fabric.js

fabric.js is a higher-level object model on top of canvas, primarily for interactive browser use. It can run on node-canvas server-side as a dependency, making them complementary rather than competing.

puppeteer/headless Chrome

Puppeteer can render canvas in a real browser engine, offering better web API compatibility. However, it carries far more overhead (full browser process). node-canvas is preferred for lightweight, high-throughput server-side generation where full browser compatibility is not required.

Skia (via @shopify/react-native-skia or canvaskit-wasm)

Skia-based alternatives offer a modern graphics backend. canvaskit-wasm provides Skia via WebAssembly without native compilation, which may suit environments where native builds are impractical. node-canvas still has broader API coverage for standard Canvas 2D use cases.