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
Support for sixel image format in less #477
Comments
Can't you use a LESSOPEN preprocessor to do this conversion? It seems a rather specialized feature to add to less itself. |
I’m not really a specialist but I don’t think any preprocessing could help. The way I see it (which may be wrong) is that the sixel protocol is doing to pixel what ANSI is doing to characters. So any rendering has to be done in less itself (you could not preprocess ANSI). But I have no idea how hard it could be. All I know is that I could take the following file and do "cat sixel.txt" in my terminal : it will display a picture. But "less sixel.txt" is full of garbage. (I want to be clear that I’m launching a discussion about the subject here because I find it interesting. I have no preconceived opinion on what could or should be done. Thanks a lot for your work on less !) |
It already works! :-)
|
Oh yeah, with your examples, it works in xterm. That’s really interesting so it seems my own issues are not related to less but probably to the terminal (and also to my own sixels files) |
FWIW, the Wikipedia article says sixel sequences begin with |
yes, I messed up the file. This version should be valid: |
Proposal : adding support for images encoded using the sixel format in less.
https://en.wikipedia.org/wiki/Sixel
Usecase : Offpunk is a CLI webbrowser which translates HTML pages to ANSI, save the result in a file then open it in less.
Images are converted to ANSI symbols using Chafa. See screenshot on:
https://sr.ht/~lioploum/offpunk/
Chafa: https://hpjansson.org/chafa/
Chafa also supports encoding images to the sixel format, which would be a lot less useful but is not supported by less.
Proposal would be to allow less to understand sixel images and display them (probably when enabled using a paramater).
For terminals supporting sixel, see:
https://www.arewesixelyet.com/
The text was updated successfully, but these errors were encountered: