Explained Kitty protocol image support and limitations.
UnderstandCreated Node.js app demoing RGBA framebuffer at 60fps.
BuildRan demo and encountered runtime error with buffer copy.
ReproduceFixed buffer copy method to use correct API.
Editso, kitty protocol has image support, right? do you think we could simulate something like an rgba framewbuffer with that we can write to at 60fps?
Kitty has graphics protocol support, so you can push images. For 60fps RGBA framebuffer simulation, it depends on terminal performance. In practice, image uploads are heavy. You can stream by sending new images each frame, but throughput and latency will likely cap well below 60fps for large frames. Also, Kitty images are chunked and often re-encoded, so you do not get a true shared framebuffer with zero copy updates.
If you want a smoother effect, you can try smaller regions, lower resolution, or limited dirty rect updates. For a full screen 60fps RGBA buffer, it is not realistic in most terminal setups.
read @packages/tui/README.md create a standalone node app that tries to proof that out in @packages/tui/test/ using @packages/tui/src/components/image.ts in a simple tui
jesus stop fucking around so much, you should know enough by now, noß0
just write a simple self containted node ap as a .ts file invokable via npx tsx, like the other demos in that folder. it should create a pixel buffer (320x200) which we draw to, which then gets shown in the tui via an image component. it should update somehow, say a rectangle bouncing around from the edges of the buffer, red, background of buffer black. just to see if perfomance is there
Summary:
packages/tui/test/image-framebuffer.ts with a 320x200 RGBA buffer demo that encodes PNG frames and renders them via the Image component at ~60fps.Run:
npx tsx packages/tui/test/image-framebuffer.tsTests not run.
➜ pi-mono git:(main) ✗ npx tsx packages/tui/test/image-framebuffer.ts
Framebuffer Image Test
FPS: 0
Press Ctrl+C to exit /Users/badlogic/workspaces/pi-mono/packages/tui/test/image-framebuffer.ts:133 rgba.copy(raw, rowOffset + 1, y * stride, y * stride + stride); ^
TypeError: rgba.copy is not a function at encodePng (/Users/badlogic/workspaces/pi-mono/packages/tui/test/image-framebuffer.ts:133:8) at updateScene (/Users/badlogic/workspaces/pi-mono/packages/tui/test/image-framebuffer.ts:88:14) at Timeout._onTimeout (/Users/badlogic/workspaces/pi-mono/packages/tui/test/image-framebuffer.ts:55:2) at listOnTimeout (node:internal/timers:605:17) at process.processTimers (node:internal/timers:541:7)
Node.js v25.2.1 ➜ pi-mono git:(main) ✗
Updated packages/tui/test/image-framebuffer.ts to copy RGBA rows with raw.set(...) instead of rgba.copy(...).
Run:
npx tsx packages/tui/test/image-framebuffer.tsTests not run.