Skip to content
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

Add support for Framebuffer graphics #200

Open
xplshn opened this issue Apr 23, 2024 · 4 comments
Open

Add support for Framebuffer graphics #200

xplshn opened this issue Apr 23, 2024 · 4 comments
Labels
feature New feature or request

Comments

@xplshn
Copy link

xplshn commented Apr 23, 2024

It'd be great if Chafa supported Framebuffer graphics, one can use fbsplash to display images in the framebuffer of the Linux console if the image is in the PPM format, if you need more details about how it works, see https://github.com/kraxel/fbida

Thanks! This would be specially great for all the programs based on Chafa! Like the Kew music player for example!

@hpjansson
Copy link
Owner

hpjansson commented Apr 23, 2024

Interesting proposal, but direct rendering is a bit outside our wheelhouse. Currently we just generate terminal escape sequences and leave the rendering to the terminal. You can make this work in the framebuffer using fbterm, which is fully supported - but AFAICT fbterm doesn't support any graphics protocol, only ANSI art.

However, I have long term plans kicking around for an API that leaves all the rendering details to Chafa. This could take the form of a ChafaDisplay and an asynchronous loop to update it. It would require Chafa to own the display and act a lot like ncurses. ChafaDisplay could in theory be anything - a terminal, framebuffer, conpty, SDL surface or what have you. It'll take us some time to get there, though, since more scaffolding would be needed (e.g. move to GObject so we can have a clean API with signals, API for image placement, update deltas, etc).

It'll probably take at least a year before I've gotten that out of the way (this is a part-time project, so I have to prioritize) and have a chance to look at a framebuffer backend. I'll keep this issue open as a reminder.

In the meantime, the simplest way to improve on this situation would be to implement a graphics protocol (e.g. sixels) in fbterm or some other framebuffer terminal. I could add support for that to Chafa quickly.

@hpjansson hpjansson added the feature New feature or request label Apr 23, 2024
@j4james
Copy link

j4james commented Apr 23, 2024

If you're looking for a framebuffer terminal that can do graphics, I know yaft has some level of sixel support. However, it doesn't appear to be maintained anymore, so if there are bugs, you'll just have to learn to live with them.

@hpjansson
Copy link
Owner

Thanks, James - I completely forgot about yaft! We do support sixels there. Must've been working ok when I tested it - it will be enabled if TERM=yaft or TERM=yaft-256color.

@xplshn
Copy link
Author

xplshn commented Apr 23, 2024

@hpjansson I think this library/program being small is its biggest feature, simply using fbsplash if it is available is the best solution to support framebuffer sessions as well as terminal sessions. Anyways, thanks for this awesome piece of software!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants