# automattic/node-canvas

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/automattic-node-canvas).**

10,676 stars · 1,193 forks · JavaScript

## Links

- GitHub: https://github.com/Automattic/node-canvas
- awesome-repositories: https://awesome-repositories.com/repository/automattic-node-canvas.md

## Description

node-canvas is a server-side 2D vector graphics and image processing library for Node.js. It provides a server-side implementation of the HTML5 Canvas API using the Cairo graphics library as its rendering engine to draw shapes, text, and paths.

The library enables the programmatic generation of dynamic images and the creation of scalable vector graphics and PDF documents. It supports the registration of custom and system fonts for typography rendering and allows for the import of image assets via local paths, buffers, data URIs, and remote URLs.

Capabilities include low-level pixel manipulation and the application of visual styles such as gradients, patterns, and shadows. Content can be exported to various formats, including PNG, JPEG, PDF, and SVG.

## Tags

### Web Development

- [Server-Side Image Generators](https://awesome-repositories.com/f/web-development/server-side-image-generators.md) — Provides a server-side implementation of the Canvas API to generate dynamic images and graphics within Node.js.

### Graphics & Multimedia

- [2D Primitive Rendering](https://awesome-repositories.com/f/graphics-multimedia/2d-spatial-rendering/2d-primitive-rendering.md) — Provides 2D rendering primitives for drawing rectangles, lines, and paths with custom styles. ([source](https://github.com/automattic/node-canvas#readme))
- [2D Vector Graphics Libraries](https://awesome-repositories.com/f/graphics-multimedia/2d-vector-graphics-libraries.md) — Provides a comprehensive toolset for drawing shapes, text, and paths with vector output support.
- [Canvas Exporters](https://awesome-repositories.com/f/graphics-multimedia/design-to-image-exporters/image-export-to-file/canvas-exporters.md) — Exports visual canvas content to files or streams in PNG, JPEG, PDF, and SVG formats. ([source](https://github.com/automattic/node-canvas#readme))
- [Vector Graphics Renderers](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/rendering/vector-rendering-pipelines/vector-graphics-renderers.md) — Uses the Cairo graphics library as its primary native engine to render vector graphics and perform rasterization.
- [Text Rendering](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/text-rendering.md) — Renders text strings onto the canvas with configurable fonts and precise measurement metrics. ([source](https://github.com/Automattic/node-canvas/wiki/Compatibility-Status))
- [Graphics Rendering Engines](https://awesome-repositories.com/f/graphics-multimedia/graphics-rendering-engines.md) — Integrates a native rendering engine that provides high-quality anti-aliasing and transformations.
- [HTML5 Canvas Libraries](https://awesome-repositories.com/f/graphics-multimedia/html5-canvas-libraries.md) — Implements the HTML5 Canvas API on the server side for Node.js using the Cairo rendering engine.
- [Image File Loading](https://awesome-repositories.com/f/graphics-multimedia/image-file-loading.md) — Supports importing image assets from local paths, buffers, data URIs, and remote URLs into memory. ([source](https://github.com/automattic/node-canvas#readme))
- [Image Graphics Rendering](https://awesome-repositories.com/f/graphics-multimedia/image-graphics-rendering.md) — Provides capabilities to draw external images and buffers onto a canvas surface. ([source](https://github.com/Automattic/node-canvas/wiki/Compatibility-Status))
- [Node.js Image Processing](https://awesome-repositories.com/f/graphics-multimedia/node-js-image-processing.md) — Offers image processing capabilities for the Node.js runtime, including pixel manipulation and format export.
- [Fill and Stroke Styles](https://awesome-repositories.com/f/graphics-multimedia/graphics-and-media/shape-drawing/sketchy-fill-generators/fill-and-stroke-styles.md) — Enables applying colors, gradients, patterns, and shadows to fill and stroke vector shapes. ([source](https://github.com/Automattic/node-canvas/wiki/Compatibility-Status))
- [Programmatic SVG Generation](https://awesome-repositories.com/f/graphics-multimedia/graphics-and-media/vector-graphics-resources/svg-graphic-drawing/programmatic-svg-generation.md) — Generates resolution-independent scalable vector graphics files programmatically from code.
- [Advanced Typography Rendering](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/advanced-typography-rendering.md) — Renders text using custom fonts and advanced typographic controls for high-fidelity branded content.
- [Rendering Quality Settings](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/rendering/graphics-apis-bindings/graphics-rendering-apis/rendering-quality-settings.md) — Provides configuration options for anti-aliasing and transformation smoothness to balance fidelity and performance. ([source](https://github.com/automattic/node-canvas#readme))
- [In-Memory Image Buffers](https://awesome-repositories.com/f/graphics-multimedia/in-memory-image-buffers.md) — Decodes external images into in-memory pixel buffers for high-performance rendering on the canvas surface.
- [Vector Output Formats](https://awesome-repositories.com/f/graphics-multimedia/qr-code-generators/vector-output-formats.md) — Generates content in SVG or PDF formats using specialized native backends. ([source](https://github.com/Automattic/node-canvas/wiki/Compatibility-Status))
- [SVG Document Exporters](https://awesome-repositories.com/f/graphics-multimedia/svg-element-generators/svg-document-exporters.md) — Produces scalable vector graphics documents by specifying the SVG canvas type. ([source](https://github.com/automattic/node-canvas#readme))
- [Text Typography Controls](https://awesome-repositories.com/f/graphics-multimedia/text-typography-controls.md) — Canvas node typography management for controlling language codes, bidirectional directionality, and text alignment. ([source](https://github.com/Automattic/node-canvas/blob/master/CHANGELOG.md))

### Programming Languages & Runtimes

- [Node.js Native Addons](https://awesome-repositories.com/f/programming-languages-runtimes/node-js-native-addons.md) — Implements high-performance graphics processing by binding JavaScript calls to native C++ implementations.

### User Interface & Experience

- [Font Registrations](https://awesome-repositories.com/f/user-interface-experience/styling-theming-systems/typography-and-iconography/typography/font-libraries/custom-font-registrars/font-registrations.md) — Allows programmatic registration and deregistration of custom typefaces for server-side text rendering. ([source](https://github.com/automattic/node-canvas#readme))
- [System Font Integration](https://awesome-repositories.com/f/user-interface-experience/typography-customization/font-imports/system-font-integration.md) — Integrates with system font libraries to load and manage native typefaces. ([source](https://github.com/Automattic/node-canvas/blob/master/CHANGELOG.md))
- [2D and 3D Element Transformations](https://awesome-repositories.com/f/user-interface-experience/grid-layout-engines/2d-and-3d-element-transformations.md) — Implements 2D spatial transformations including scaling, rotation, and matrix applications for canvas elements. ([source](https://github.com/Automattic/node-canvas/blob/master/CHANGELOG.md))
- [Custom Font Registrars](https://awesome-repositories.com/f/user-interface-experience/styling-theming-systems/typography-and-iconography/typography/font-libraries/custom-font-registrars.md) — Maps typeface identifiers to native rendering glyphs by integrating with system and custom font libraries.

### Part of an Awesome List

- [Low-Level Pixel Buffer Access](https://awesome-repositories.com/f/awesome-lists/media/pixel-level-image-manipulation/low-level-pixel-buffer-access.md) — Allows direct access to contiguous memory buffers for high-performance raw pixel manipulation. ([source](https://github.com/Automattic/node-canvas/wiki/Compatibility-Status))
- [Canvas and Graphics](https://awesome-repositories.com/f/awesome-lists/media/canvas-and-graphics.md) — Cairo-backed Canvas implementation for Node.js.

### Content Management & Publishing

- [PDF Document Generation](https://awesome-repositories.com/f/content-management-publishing/pdf-document-generation.md) — Enables the programmatic generation of multi-page PDF documents with custom layouts and vector graphics.

### Data & Databases

- [Pixel-Buffer Memory Mapping](https://awesome-repositories.com/f/data-databases/data-access-querying/memory-mapped-file-access/graphics-memory-mapping/pixel-buffer-memory-mapping.md) — Maps raw image data to contiguous memory buffers for direct pixel manipulation and high-speed exports.
