FR version is available. Content is displayed in original English for accuracy.
Advertisement
Advertisement
⚡ Community Insights
Discussion Sentiment
50% Positive
Analyzed from 260 words in the discussion.
Trending Topics
#emacs#buffer#https#com#image#canvas#enable#graphics#things#headless

Discussion (3 Comments)Read Original on HackerNews
> 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.
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
³ https://codeberg.org/monadicsheep/pale
⁴ https://github.com/emacs-os/embr.el