NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3456 most downloaded on npm
Canvas graphics API backed by Cairo
Last release 1 months ago
15 Aug 2026
Release timing varies
gaps range from 8 days to 5 months
Some releases are documented
notes for 30 of the last 60 stable releases
4 versions withdrawn
withdrawn after publishing
16 years old
161 releases · first in 2010
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Fixed * Fix building with gcc
One column per quarter.
Several security fixes for untrusted inputs to getImageData and putImageData. Thanks to Ethan Kim for the report.
ctx.direction not affected by ctx.save and ctx.restoreFix error message HTTP response status code in image src setter
roundRect() shape incorrect when radii were large relative to rectangle size (#2400)Added ctx.lang to set the ISO language code for text
ctx.lang to set the ISO language code for textFix crash when setting width/height on PDF, SVG canvas
This release also introduces arm64 prebuilds for Linux!
This release also introduces arm64 prebuilds for Linux!
Replaced simple-get with Node.js builtin fetch
simple-get with Node.js builtin fetch (#2309)ctx.font has a new C++ parser and is 2x-400x faster. Please file an issue if you experience different results, as caching has been removed.fillText call (#1921)ctx.direction is implemented: 'rtl' or 'ltr' set the base direction of textctx.textAlign 'start' and 'end' are now 'right' and 'left' when ctx.direction === 'rtl'Fixed accidental depenency on ambient DOM types
Migrate from librsvg's deprecated rsvg_handle_get_dimensions() and rsvg_handle_render_cairo() functions to the new rsvg_handle_get_intrinsic_size_in_p…
This release notably changes to using N-API. 🎉
op variable to the default switch case to avoid a compiler warning. (#2229)default switch case with a null statement if some enum values aren't suppsed to be handled, this avoids a compiler warning. (#2229)rsvg_handle_get_dimensions() and rsvg_handle_render_cairo() functions to the new rsvg_handle_get_intrinsic_size_in_pixels() and rsvg_handle_render_document() respectively. (#2229)backend in the Backend class. (#2229)dtslint with tsd (#2313)Migrate from librsvg's deprecated rsvg_handle_get_dimensions() and rsvg_handle_render_cairo() functions to the new rsvg_handle_get_intrinsic_size_in_p…
This release notably changes to using N-API. 🎉
op variable to the default switch case to avoid a compiler warning. (#2229)default switch case with a null statement if some enum values aren't suppsed to be handled, this avoids a compiler warning. (#2229)rsvg_handle_get_dimensions() and rsvg_handle_render_cairo() functions to the new rsvg_handle_get_intrinsic_size_in_pixels() and rsvg_handle_render_document() respectively. (#2229)backend in the Backend class. (#2229)dtslint with tsd (#2313)Migrate from librsvg's deprecated rsvg_handle_get_dimensions() and rsvg_handle_render_cairo() functions to the new rsvg_handle_get_intrinsic_size_in_p…
[!NOTE] Prebuilds are currently only available for Linux (x64, glibc), macOS (x64) and Windows (x64). Please give this version a try and let us know if you run into issues!
npm install canvas@next
This release notably changes to using N-API. 🎉
op variable to the default switch case to avoid a compiler warning. (#2229)default switch case with a null statement if some enum values aren't suppsed to be handled, this avoids a compiler warning. (#2229)rsvg_handle_get_dimensions() and rsvg_handle_render_cairo() functions to the new rsvg_handle_get_intrinsic_size_in_pixels() and rsvg_handle_render_document() respectively. (#2229)backend in the Backend class. (#2229)dtslint with tsd (#2313)Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
_Note: this is the first version with prebuilds for Node.js v20._
Note: this is the first version with prebuilds for Node.js v20.
Add missing property canvas to the CanvasRenderingContext2D type
canvas to the CanvasRenderingContext2D typeletter-spacing effectctx.font not being restored correctly after ctx.restore() (#1946)Replace triple-slash directive in types with own types to avoid polluting TS modules with globals
Fix Assertion failed: (object->InternalFieldCount() > 0), function Unwrap, file nan_object_wrap.h, line 32.
Assertion failed: (object->InternalFieldCount() > 0), function Unwrap, file nan_object_wrap.h, line 32. (#2025)textBaseline and textAlign were not saved/restored by save()/restore(). (#1936)save()/restore().save()/restore() no longer have a maximum depth (previously 64 states).Fix actualBoundingBoxLeft and actualBoundingBoxRight when textAlign='center' or 'right'
rgba(r,g,b) with no alpha should parse as opaque, not transparent.
pangoVersionctx.roundRect()rgba(r,g,b) with no alpha should parse as opaque, not transparent. (#2029)PngConfig.filters types. (#2072)createPattern() always used "repeat" mode; now supports "repeat-x" and "repeat-y". (#2066)context.arc(). (#2055)context.arc() geometry logic for full ellipses. (#1808, (#1736))deregisterAllFonts to the Typescript declaration file (#2096)User-Agent header when requesting remote images (#2099)Wrong fonts used when calling registerFont multiple times with the same family name
registerFont multiple times with the same family name (#2041)All exports now work when Canvas is used in ES Modules (ESM).
Stringify CanvasGradient, CanvasPattern and ImageData like browsers do. (#1639, #1646)
toupper.getImageData or putImageData is called on a PDF or SVG canvas (#1853)Changed DOMPoint() constructor to check for parameter nullability.
DOMPoint() constructor to check for parameter nullability.DOMMatrix.js to use string literals for non-special cases.deregisterAllFonts method to free up memory and reduce font conflicts./opt/homebrew/libThe C++ class method nBytes() now returns a size_t. (Because this is a C++ method only, this is not considered a breaking change.)
node_pre_gyp_accessKeyId, you may need to make changes to your
installation procedure. See https://github.com/mapbox/node-pre-gyp/blob/master/CHANGELOG.md#100.nBytes() now returns a size_t. (Because this is a C++
method only, this is not considered a breaking change.)inverse() and invertSelf() to DOMMatrix (#1648)context.getTransform() (#1769)context.setTransform(dommatrix) (#1769)actualBoundingBoxLeft and actualBoundingBoxRight returned by measureText to be the ink rect (#1776, fixes #1703).Note: This is the first prebuild served from Automattic/node-canvas. Previous release prebuilds are served from https://github.com/node-gfx/node-canva
Note: This is the first prebuild served from Automattic/node-canvas. Previous release prebuilds are served from https://github.com/node-gfx/node-canvas-prebuilt/releases.
fillStyle= and strokeStyle=rsvgVersion.setTransform method is no longer missingfillStyle or strokeStyle is set to an object, but that object is not a Gradient or Pattern. (This behavior was non-standard: invalid inputs are supposed to be ignored.)Ignore maxWidth in fillText and strokeText if it is undefined
maxWidth in fillText and strokeText if it is undefinedAllow larger buffers to be returned from toBuffer('raw').
toBuffer('raw').fillStyle or strokeStyle
was set to a CanvasPattern or CanvasGradient (#1357).toBuffer('raw') with large canvases (#1158).toBuffer('raw') in readme. (#1416)Set and Call. (#1415)Get version from Nan instead of v8. (#1415)Support redirects when fetching images (using simple-get)
Guard JPEG width/height against maximum supported
canvas.toDataURL()Fix custom "inspect" function deprecation warnings
resolution option for canvas.toBuffer("image/png") and
canvas.createPNGStream(). This was documented since 2.0.0 but not working.canvas.createPDFStream()Fix canvas.toBuffer() for JPEGs
canvas.toBuffer() for JPEGs (#1350)Add support for multiple PDF page sizes
canvas.toBuffer() (#1202, #1296)ctx.font= (#1202)### Added * BMP support ### Fixed * Reset context on resurface (#1292) * Support Jest test framework
Warn when building with old, unsupported versions of cairo or libjpeg.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →