unstale

npm / canvas

canvas

What changed in canvas 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-24.

7 breaking2 security1 new APIs and options1 behavior and defaults1 tooling13 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

canvas 325 changes

Breaking changes 7

  • loadImage now rejects when src is null or invalid.

    3.2.1release notes

  • Cairo errors are now thrown by canvas.toBuffer().

    3.0.0release notes

  • Exif orientation in JPEG files is no longer ignored.

    3.0.0release notes

  • 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.0release notes

  • The native addon migrated to N-API and removed libuv and V8 dependencies.

    3.0.0release notes

  • Support for Node.js 16.x and below was dropped, so applications must use a newer Node.js version.

    3.0.0release notes

  • PNG constants are now static properties of the Canvas class.

    3.0.0release notes

Security 2

  • Security fixes address untrusted inputs to getImageData.

    3.2.2release notes

  • Security fixes address untrusted inputs to putImageData.

    3.2.2release notes

New APIs and options 1

  • String tags were added to support class detection.

    3.0.0release notes

Behavior and default changes 1

  • RGB functions now support real numbers instead of only integers.

    3.0.0release notes

Tooling 1

  • The package changed its native-binary installation tool from node-pre-gyp to prebuild-install.

    3.0.0release notes

Fixes and other changes 13

  • Fixes building with gcc.

    3.2.3release notes

  • ctx.direction is now affected by ctx.save and ctx.restore.

    3.2.2release notes

  • PDF pages are preserved when changing width and height.

    3.2.2release notes

  • Fixes compilation on GCC 15.

    3.2.1release notes

  • Corrects the shape drawn by roundRect() when radii are large relative to the rectangle size.

    3.2.1release notes

  • The image src setter now reports the correct HTTP response status code in its error message.

    3.2.1release notes

  • Class properties now have defaults, consistent with standard JavaScript classes.

    3.0.0release notes

  • Parsing of rgb functions and leading or trailing whitespace in CSS colors was fixed.

    3.0.0release notes

  • Missing methods were added to align DOMMatrix with the spec.

    3.0.0release notes

  • Missing methods were added to align DOMPoint with the spec.

    3.0.0release notes

  • Font-family names may contain alternate or properly escaped quotes.

    3.0.0release notes

  • The type of setTransform was corrected.

    3.0.0release notes

  • The TextMetrics type now includes alphabeticBaseline, emHeightAscent, and emHeightDescent properties.

    3.0.0release notes