Comments (2)
npm:canvas seems like already supported this
import fs from 'node:fs'
import { createCanvas, loadImage } from 'canvas'
const canvas = createCanvas(1080, 1080)
const ctx = canvas.getContext('2d')
// Draw cat with lime helmet
loadImage('scripts/test-svg.svg').then((image) => {
ctx.drawImage(image, 0, 0)
fs.writeFileSync('scripts/test-svg.png', canvas.toBuffer('image/png'))
})
from canvas.
Same here. I also get this in the console:
cannot append child nodes to this element.
can't render image: load image failed
from canvas.
Related Issues (20)
- Support for 32-bit Windows HOT 1
- actualBoundingBox failing when facing some non-default characters, though when .fillText() - they're rendered completely okay
- loading an invalid SVG causes an uncatchable error
- Setting canvas width or height resets font HOT 1
- Rotation does not work at all. HOT 1
- Add LoongArch64 support HOT 1
- registerFromPath() works but register() does not with the same file
- ctx.restore fails after ctx.scale(0,0)
- Getting non premultiplied pixel data
- Add windows arm64 build
- Shadow rendered incorrectly when ctx.translate is applied (with examples)
- Shadow blur 0 makes text shadow not render at all
- Possible Segmentation fault
- `loadImage()` does not handle exceptions properly, causing calling code to crash ("floating" async code)
- 2000x slower drawImage HOT 2
- Cannot cache Img objects?
- GlobalFonts can provide a method to clear or remove a font?
- imageSmoothingQuality="high" is invalid
- Android CMAKE build issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from canvas.