-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pixel graphics in terminal #164
Comments
I love that you are looking into this! :) It will be so exciting seeing what you come up with. Some references that you DON'T have to care about, you do your own thing! :-)If you choose to support sixel for the user-facing terminal, there are two very fast and interesting encoders: On mixing images and cells:
💗 |
Thanks for the links! I need to read it and get into it. 🙂 |
I doubt the necessity of using multiple layers in terminals. Offhand, I can't imagine a scenario where an image should be on top of text, except for drawing a graphical mouse cursor moving with pixel precision, as well as a scenario for drawing a stack of translucent UI windows with images on top of text. Since pixel accuracy is not available to us (we operate at the cell level, and the cell size is unknown), the case with a graphic mouse cursor is not suitable. The scenario with drawing a stack of translucent UI windows with images on top of the text also does not suit us, since we do not draw glyphs on top of each other, we only draw the topmost glyph, so why should the glyph be visible through the space character, but not through the rest of the glyphs? All the content that I see in the GUI or in the web browser - everywhere the text is on top of the images. So far, I see only useful use of a solid background, or an image and text on top of that. Where a solid background is just a single pixel image. |
With the caveat that you should do your thing first, always, so I only explain some of my motivation but do not want to influence wherever you are going :) -- I am aiming to develop some gaming capabilities for the terminal. |
"subscribe" (Hello from my new account. :) ) |
The terminal must operate only at the cell level and have access to any cell without harming neighboring cells. There should not be any inseparable blocks like wide characters.
The cell can contain anything:
In order to allow the application to output bitmap images to the terminal, and for the terminal, in turn, it is convenient to store them in a scrollback, reflow and render, I propose to operate with hashes of fragments of these images as the content for cells of the "image" type. When displaying such a cell, the raster is always stretched to cover the entire cell. If the application somehow knows the size of the cell in pixels, then it can display images one-to-one, if not known, then the application must follow that the aspect ratio of the cell is 1:2.
This approach also covers the following use cases:
Usage
To display an image, the application outputs at the current cursor position the following sequence:
If the terminal does not know about such a hash_tile_id, it asynchronously asks the application about this ID:
The application must respond with content (if the application does not respond, then the terminal displays a stub in this cell until it learns about this hash_tile_id).
To avoid such questions from the terminal, the application can tell the terminal in advance about the displayed hash_tile_id. The terminal will store them until the cells with these IDs leave the scrollback (or use some sort of ring buffer where the user can specify a limit).
The text was updated successfully, but these errors were encountered: