This is a good example of a CS project you would do at Stanford and wouldn't get assigned at your local university.
I talk to people who think a CS degree has the same content and the same level of rigour and challenge everywhere. Absolutely baffles me.
Stanford CS248: Implement an SVG Rasterizer
61–70 of 82 posts
Re: Stanford CS248: Implement an SVG Rasterizer
#62What's a good JavaScript-based solution to render SVG into an image? html2canvas doesn't work well with SVG, especially those heavily styled with CSS.
If you're not in a Node.js context, the Canvas API does a decent job of rasterizing SVGs nowadays. Once rasterized, you can call canvas.toDataURL() to get a download link. Here's a demo: https://codepen.io/hypothete/pen/WNvKLEE
Re: Stanford CS248: Implement an SVG Rasterizer
#63Re: Stanford CS248: Implement an SVG Rasterizer
#64Earlier quoted context omitted.
If you're not in a Node.js context, the Canvas API does a decent job of rasterizing SVGs nowadays. Once rasterized, you can call canvas.toDataURL() to get a download link. Here's a demo: https://codepen.io/hypothete/pen/WNvKLEE
I used to have troubles with retina displays, I always got a blurred image, no matter to what trick I tried. Is there a way to fix the rendering pixel ratio to 1?
Re: Stanford CS248: Implement an SVG Rasterizer
#65Earlier quoted context omitted.
I used to have troubles with retina displays, I always got a blurred image, no matter to what trick I tried. Is there a way to fix the rendering pixel ratio to 1?
The usual approach with canvas for high dpi is to increase the size of the canvas and then scale it back down afterwards: https://codepen.io/graup/pen/jOPpopR
Re: Stanford CS248: Implement an SVG Rasterizer
#66What's a good JavaScript-based solution to render SVG into an image? html2canvas doesn't work well with SVG, especially those heavily styled with CSS.
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Hea...
https://developers.google.com/web/updates/2017/04/headless-c...
and in dev panel https://developer.mozilla.org/en-US/docs/Tools/Taking_screen...
Re: Stanford CS248: Implement an SVG Rasterizer
#67Is there a similar course about Boolean operations on general Bezier shapes out there somewhere? Thanks!
That's the class I'm currently taking.
Re: Stanford CS248: Implement an SVG Rasterizer
#68Re: Stanford CS248: Implement an SVG Rasterizer
#69Earlier quoted context omitted.
I talk to people who think a CS degree has the same content and the same level of rigour and challenge everywhere. Absolutely baffles me.
What makes you so confident saying this?
You can also just go to any university website yourself and compare their syllabi and see how different they are.
Re: Stanford CS248: Implement an SVG Rasterizer
#70I've already implemented an SVG renderer at https://www.amanithsvg.com based on our openvg engine with software rasterization https://www.amanithvg.com Both are closed source, but there are evaluation version available, if someone is interested in compare rendering quality and speed.