@napi-rs/canvas
1.1.0 · 30 Oct 2026MIT47.9M / weekRepositoryHomepagenpmAtom feed
125 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 1.x · latest line
1.1.0
30 Oct 2026build: Bind the addon's own symbols on Linux so Electron's cxx runtime cannot replace them
text: Draw text the same on every OS by default, add setTextRenderer
path: Draw full-sweep arc() and ellipse() for every start angle
Highlights
Portable text rendering by default
Text now defaults to the
portablerenderer, using FreeType on macOS, Linux, and Windows to make rendering andmeasureTextresults consistent across operating systems when the same fonts are registered.Behavior change: default text output, measurements, and system-font resolution can differ from v1.0.12/v1.0.13. To restore the previous Chrome-like, platform-specific behavior, call:
const { setTextRenderer } = require('@napi-rs/canvas') setTextRenderer('system')Use
getTextRenderer()to inspect the active mode. Installed fonts and fallback for characters missing from registered fonts can still vary by OS and machine.What's Changed
build: Bind the addon's own symbols on Linux so Electron's cxx runtime cannot replace them
text: Draw text the same on every OS by default, add setTextRenderer
path: Draw full-sweep arc() and ellipse() for every start angle
path: Draw a degenerate ellipse() as straight lines like Chrome
build: Compile Windows Skia with -ffp-contract=off like Chromium
path: follow-ups to #1408: rotate() path, arc() start == end, rotated ellipse, isPointInStroke state, one-point stroke prune
build: Compile skia-c with -ffp-contract=off like Chromium
ctx: Keep Blink's double CTM as the source of truth
ctx: Decide CTM invertibility from Blink's double CTM
ctx: Skip the stroke of every one-point path like Chrome
1.0.13
21 Oct 2026canvas: Wrap native methods, not previous wrappers, on re-evaluation
1.0.12
20 Oct 2026canvas: Preserve fractional global alpha through native paints
canvas: Preserve pattern snapshots and honor current image sampling quality
canvas: Enable dithering for gradient fill and stroke paints
What's Changed
canvas: Preserve fractional global alpha through native paints
canvas: Preserve pattern snapshots and honor current image sampling quality
canvas: Enable dithering for gradient fill and stroke paints
Retain display-p3 backing surfaces through context acquisition and resize
canvas: WebIDL conversion for ImageData, getContext, createPattern
canvas: Match Chrome for hsl() colors and gradient edge cases
canvas: ImageData patterns and SvgCanvas reads like Chrome
Reset style getters on resize, tag AVIF color, exact PDF alpha
canvas: Match Chrome for alpha:false, clearRect and 'copy'
skia: Build Skia with Chrome's CPU raster defines and blitters
canvas: Draw Image sources from Chrome's decode-cache levels
crash-safe non-finite args, ImageData sizes, DOMMatrixInit
canvas: WebIDL conversion, arity checks and exceptions like Chrome
imagedata: ImageData and get/put/createImageData work like Chrome
canvas: Paths, clips, roundRect and setTransform work like Chrome
canvas: Style getters, shadowColor and canvas sizes like Chrome
canvas: Gradients and SVG conic export work like Chrome
color: CSS Color 4/5 at every canvas color site, like Chrome
canvas: Compositing, shadows, drawCanvas and filters like Chrome
codecs: Chrome's encoders, AVIF decode, data: URLs and SVG images
canvas: Parse fonts, lay out and measure text like Blink
canvas: Rasterize text like Chrome with CoreText and Fontations
canvas: float16 canvas storage and float ImageData formats
svg: Draw SVG images like Chrome: CSS, var(), <use>, <image>
canvas: Write DPI and text metadata in toBuffer, encode and encodeSync
chrome/m157
1.0.11
10 Oct 2026Emit CycloneDX SBOMs for platform packages
Start a new subpath for each Path2D.addPath call
What's Changed
Emit CycloneDX SBOMs for platform packages
Start a new subpath for each Path2D.addPath call
1.0.10
1 Oct 2026use-after-free when ctx.restore() revives a GC'd CanvasPattern
Release deferred recording on reads and cap recorded memory
chrome/m156
What's Changed
use-after-free when ctx.restore() revives a GC'd CanvasPattern
Release deferred recording on reads and cap recorded memory
chrome/m156
1.0.9
9 Sep 2026Invalidate FontCollection typeface cache on font registration
chrome/m154
What's Changed
Invalidate FontCollection typeface cache on font registration
chrome/m154
1.0.8
24 Aug 2026Capture call-time snapshot in async encode APIs
Snapshot canvas source in drawImage to avoid per-call pixel copy
What's Changed
Capture call-time snapshot in async encode APIs
Snapshot canvas source in drawImage to avoid per-call pixel copy
1.0.7
18 Aug 2026Fast getImageData readback with runtime-dispatched SIMD unpremultiply
putImageData no longer inherits transform/clip after getImageData
1.0.6
13 Aug 2026Keep skia surface alive during async encode
1.0.5
9 Aug 2026Prefer raster signatures over SVG markers
Reject malformed raster images
What's Changed
Prefer raster signatures over SVG markers
Reject malformed raster images
1.0.3
28 Jul 2026shadow: Apply shadowColor alpha once instead of squaring it
shadow: Align Canvas2D shadows with Chromium
chrome/m151
What's Changed
shadow: Apply shadowColor alpha once instead of squaring it
shadow: Align Canvas2D shadows with Chromium
chrome/m151
1.0.2
30 Jun 2026chrome/m149
1.0.1
24 Jun 2026Link aarch64-pc-windows-msvc against static CRT
Missing icudtl.dat in win32-arm64 package
1.0.0
4 May 2026We have achieved ~11m/week downloads, and the API is stable, so we have decided to release version 1.0 at this time. There are no breaking changes; it's safe for everyone to upgrade.
- 0.1.x
0.1.100
26 Apr 2026image: loadImage settles on invalid input
What's Changed
image: loadImage settles on invalid input
0.1.99
18 Apr 2026drawImage gray halo on transparent PNG edges with imageSmoothingEnabled
Allow canvas package postinstall script for benchmark CI
What's Changed
drawImage gray halo on transparent PNG edges with imageSmoothingEnabled
Allow canvas package postinstall script for benchmark CI
0.1.98
15 Apr 2026Chrome m148
What's Changed
Chrome m148
0.1.97
16 Mar 2026Use signed integers for canvas APIs that accept negative coordinates
What's Changed
Use signed integers for canvas APIs that accept negative coordinates
0.1.96
5 Mar 2026Prevent memory leak when drawing canvas onto another via drawImage()
What's Changed
Prevent memory leak when drawing canvas onto another via drawImage()
0.1.95
24 Feb 2026Snapshot pixel data in putImageData for deferred rendering mode
0.1.94
20 Feb 2026putImageData incorrectly blending pixels due to Mitchell cubic resampler
0.1.93
17 Feb 2026Chrome m146
What's Changed
Chrome m146
0.1.92
12 Feb 2026Add node-canvas compatibility layer (
@napi-rs/canvas/node-canvas)putImageData bypassed deferred rendering PageRecorder
What's Changed
Add node-canvas compatibility layer (
@napi-rs/canvas/node-canvas)putImageData bypassed deferred rendering PageRecorder
0.1.91
9 Feb 2026Plug native memory leaks in SVG canvas, bitmap shader, and stream allocations
Clip with nested transforms intersects in device space
0.1.90
5 Feb 2026Copy font data in GlobalFonts.register to prevent buffer invalidation
Support http url in image src
Add Drop impl for SkPictureRecorder to prevent memory leak
What's Changed
Copy font data in GlobalFonts.register to prevent buffer invalidation
Support http url in image src
Add Drop impl for SkPictureRecorder to prevent memory leak
Prevent memory leaks in encode_stream callback and SkPixmap
0.1.89
28 Jan 2026Napi feature
Implement deferred rendering with incremental layer caching
What's Changed
Napi feature
Implement deferred rendering with incremental layer caching
0.1.88
27 Dec 2025Should throw TypeError if drawImage param mismatched
0.1.87
26 Dec 2025Make Image class HTML spec compliant for jsdom integration
Ignore Letter Spacing in Cursive Scripts
image: Make Buffer load synchronous and add decode() method
What's Changed
Make Image class HTML spec compliant for jsdom integration
Ignore Letter Spacing in Cursive Scripts
image: Make Buffer load synchronous and add decode() method
Add
ctx.langproperty for language-specific text renderingAdd
textRenderingproperty for text rendering hints
0.1.86
21 Dec 2025Chrome m144
RTL text
fillText(maxWidth)x positioning calculation error
What's Changed
Chrome m144
RTL text
fillText(maxWidth)x positioning calculation error
0.1.85
19 Dec 2025Add
fontVariantCapsfeta: Support
CanvasRenderingContext2D.reset()Initial black color string should be
#000000rather than#000
What's Changed
Lottie
See lottie-to-video.ts for example
const { LottieAnimation } = require('@napi-rs/canvas') // Load from file const animation = LottieAnimation.loadFromFile('animation.json') // Load from JSON string with resource path for external assets const animation = LottieAnimation.loadFromData(jsonString, { resourcePath: '/path/to/assets', })github.com/user-attachments/assets/e99d61a8-901…
Changelog
Add
fontVariantCapsfeta: Support
CanvasRenderingContext2D.reset()Initial black color string should be
#000000rather than#000Support windows arm64
Basic support for
directionSupport Lottie API
0.1.84
6 Dec 2025Add GIF encoding support
Add fontStretch and fontKerning support
What's Changed
Add GIF encoding support
Add fontStretch and fontKerning support
0.1.83
27 Nov 2025Add variable font support
Chrome m143
What's Changed
Add variable font support
Chrome m143
0.1.82
11 Nov 2025PDFDocument support
Add PDF annotation APIs using SkAnnotation.h for interactive links and navigation
Add Uint16Array and Float32Array support to ImageData constructor
What's Changed
PDFDocument support
Add PDF annotation APIs using SkAnnotation.h for interactive links and navigation
Add Uint16Array and Float32Array support to ImageData constructor
0.1.81
26 Oct 2025Upgrade to chrome/142
What's Changed
Upgrade to chrome/142
0.1.80
13 Sep 2025External memory usage adjustment mismatch
Shadow is not applied with transform correctly
0.1.79
8 Sep 2025DOMMatrix.invertSelf() to return self for non-invertible matrices per DOM spec
Prevent segfault when creating patterns from canvases
What's Changed
DOMMatrix.invertSelf() to return self for non-invertible matrices per DOM spec
Prevent segfault when creating patterns from canvases
0.1.78
29 Aug 2025Canvas pattern live reference issue causing incorrect rendering
Chrome m140
What's Changed
Canvas pattern live reference issue causing incorrect rendering
Chrome m140
0.1.77
8 Aug 2025Return early if setLineDash param is invalid
What's Changed
Return early if setLineDash param is invalid
0.1.75
1 Aug 20250.1.74
17 Jul 2025Upgrade to NAPI-RS 3.0.0-beta.11
Ref was deprecated in NAPI-RS
Hsl color parsing
What's Changed
Upgrade to NAPI-RS 3.0.0-beta.11
Ref was deprecated in NAPI-RS
Hsl color parsing
0.1.73
29 Jun 2025Wrong data pointer to ImageData in Electron env
What's Changed
Wrong data pointer to ImageData in Electron env
0.1.72
25 Jun 2025Use this library with webpack
putImageData doesn't work on Electron environment
What's Changed
Use this library with webpack
putImageData doesn't work on Electron environment
0.1.71
8 Jun 2025Chrome m137
Upgrade to NAPI-RS beta
Upgrade cssparser
What's Changed
Chrome m137
Upgrade to NAPI-RS beta
Upgrade cssparser
Wrong shadow alpha calculation
Memory leak in createPattern
Shadow clipping beyond canvas bounds
Chrome m138
0.1.70
2 May 2025Expose SkCornerPathEffect as round() fn on Path2D
Resize svg from file path render an empty image
What's Changed
Expose SkCornerPathEffect as round() fn on Path2D
Resize svg from file path render an empty image
0.1.69
4 Apr 2025Memory leak when creating bitmap from svg
Accept non-string param as text
Chrome m136
What's Changed
Memory leak when creating bitmap from svg
Accept non-string param as text
Chrome m136
0.1.68
4 Mar 2025Don't panic if current ts is not able to invert when transform
Draw canvas on canvas clip
Bitmap::from_image_data width and height
What's Changed
Don't panic if current ts is not able to invert when transform
Draw canvas on canvas clip
Bitmap::from_image_data width and height
Decode avif Image with libavif
Create pattern from Canvas
Make sure registered font Buffer is valid
Memory leak in some blend mode
BlendMode::Plus should be mapped to "plus" globalCompositeOperation
0.1.67
8 Feb 2025drawImage canvas implementation
Make sure SVGCanvas get content is complete
0.1.66
2 Feb 2025Double free in putImageData
Support encode stream
chrome/m133
What's Changed
Double free in putImageData
Support encode stream
chrome/m133
armv7 glibc version
Avoid memcpy while drawing canvas on canvas
Flush svg stream after write end
0.1.65
2 Dec 2024loadImage should handle file URL
What's Changed
loadImage should handle file URL