# What changed in canvas

> 25 changes in canvas 3 from its official release notes, upgrade guides and advisories: 7 breaking, 2 security, 1 new APIs and options. Each one cited. Sources checked 2026-10-24. HTML: https://unstale.sh/npm/canvas/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## canvas 3

### Breaking changes

- loadImage now rejects when src is null or invalid. (3.2.1) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.1)
- Cairo errors are now thrown by canvas.toBuffer(). (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- Exif orientation in JPEG files is no longer ignored. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- Improved font matching was reverted because it does not work when fonts are installed; the notes advise using v3.0.0-rc3 if font selection degrades. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- The native addon migrated to N-API and removed libuv and V8 dependencies. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- Support for Node.js 16.x and below was dropped, so applications must use a newer Node.js version. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- PNG constants are now static properties of the Canvas class. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)

### Security

- Security fixes address untrusted inputs to getImageData. (3.2.2) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.2)
- Security fixes address untrusted inputs to putImageData. (3.2.2) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.2)

### New APIs and options

- String tags were added to support class detection. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)

### Behavior and default changes

- RGB functions now support real numbers instead of only integers. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)

### Tooling

- The package changed its native-binary installation tool from node-pre-gyp to prebuild-install. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)

### Fixes and other changes

- Fixes building with gcc. (3.2.3) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.3)
- ctx.direction is now affected by ctx.save and ctx.restore. (3.2.2) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.2)
- PDF pages are preserved when changing width and height. (3.2.2) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.2)
- Fixes compilation on GCC 15. (3.2.1) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.1)
- Corrects the shape drawn by roundRect() when radii are large relative to the rectangle size. (3.2.1) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.1)
- The image src setter now reports the correct HTTP response status code in its error message. (3.2.1) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.2.1)
- Class properties now have defaults, consistent with standard JavaScript classes. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- Parsing of rgb functions and leading or trailing whitespace in CSS colors was fixed. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- Missing methods were added to align DOMMatrix with the spec. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- Missing methods were added to align DOMPoint with the spec. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- Font-family names may contain alternate or properly escaped quotes. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- The type of setTransform was corrected. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
- The TextMetrics type now includes alphabeticBaseline, emHeightAscent, and emHeightDescent properties. (3.0.0) — [release notes](https://github.com/Automattic/node-canvas/releases/tag/v3.0.0)
