Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- Announcement¹
What it is: a new image type, canvas, backed by an in-memory ARGB32 pixel buffer.
Why it's a big deal: the old way to get pixels on screen was render -> encode to PPM/PNG -> allocate a unibyte Lisp string (or write a temp file) -> create-image -> Emacs decodes back to pixels. Canvas deletes the round trip: the module writes into the buffer Emacs displays from. On Cairo that's a single memcpy into the surface.
Things people have already built on it:
- doom-on-emacs, via doomgeneric²
- PALE, 1080p60 video in a buffer³
- embr.el, headless Chromium streamed into a buffer over CDP screencast. Author says canvas is what took it from toy to usable⁴
- emacs-reader, the PDF viewer that motivated the whole thing.
Other possibilities this opens up:
- Notebook-style documents, live plots embedded in an ordinary editable buffer, instead of regenerating a PNG per frame.
- Live profiling and debugging views: heap graph updating in real time.
- Whiteboards, freehand annotation, stylus note-taking - excalidraw-like stuff in Emacs.
- Emulators, music visualizers, sheet-music and circuit editors, image editors, dynamically generated icons, modeline graphics, etc.
---
¹ https://mathstodon.xyz/@divyaranjan/117104660983147041
² https://github.com/minad/doom-on-emacs
by iLemming - /r/emacs discussion https://www.reddit.com/r/emacs/comments/1vpufnu/the_emacs_ca...by iLemming
- I suppose that, for fans of information management, the need for external utilities such as org-roam-ui will be obviated once native equivalents to Obsidian's Graph View appear. The sooner this supersedes GraphViz-based stopgaps such as the one in grove.el, the better (I'm guessing that graph-fa2 renders to SVG and then rapidly swaps the image in an Emacs buffer).
Other ideas: osm.el (https://github.com/minad/osm). Please!
by Igrom - The headline comes from the most recent post in the thread from Eli Zaretskii:
> Thanks, this is now installed on the master branch, and I'm therefore closing this bug.
Good news! This will enable a bunch of future in-buffer graphics features -- things like Headless/Playwright Chromium using Emacs as a display server or faster PDF viewers. Org-babel should be able to make use of this too for faster data plotting. I can only imagine the kinds of snazzy Emacs graphical UI interfaces this will enable, beyond what is being currently done using SVG hacks for rendering.
by spudlyo