You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, what do you think about Sixel support for images/graphics in the terminal?
You already do ANSI stuff in the terminal anyway. There is a recent discussion on hackernews. You can find a list of compatible terminals at arewesixelyet.com - for MacOS you have to use iTerm2, for Windows mintty from MSYS2. Support for programming languages can be found at github.com/saitoha/libsixel with an extensive list of software that can use it (e.g. gnuplot, web browser, even full X11 client). More formal documentation seems to be at vt100.net.
You can probably use it as a poor man's graphics library till you have full GUI/graphics in your Rebol3.
I have made a proof of concept function for myself to convert binary images to sixel encoding but a proper codec(?) would probably be more appropriate. Unfortunately that is above my programming abilities..
sixel_image: funct [binaryimg /inline] [
a: either (find get-env "TERM" "screen") ["^(esc)Ptmux;^(esc)^(esc)]"] ["^(esc)]"]
b: "1337;File="
d: ajoin ["size=" length? binaryimg]
e: ajoin [";inline=" either inline [0] [1]]
f: ":"
g: enbase/flat binaryimg 64
h: either (find get-env "TERM" "screen") ["^g^(esc)\"] [#"^g"]
i: #"^n"
ajoin [a b d e f g h i]
]
>> print sixel_image read http://www.rebol.com/graphics/reb-logo.gif
<image displayed here>
>> print sixel_image read %image.jpg
<image displayed here>
I have used code at imgcat.nu as a blueprint. I have kept the inline parameter even though it does not seem to work and the original source always keeps it at 1.
Thank you for your work and wish you all the best!
This discussion was converted from issue #71 on April 17, 2024 08:28.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, what do you think about Sixel support for images/graphics in the terminal?
You already do ANSI stuff in the terminal anyway. There is a recent discussion on hackernews. You can find a list of compatible terminals at arewesixelyet.com - for MacOS you have to use iTerm2, for Windows mintty from MSYS2. Support for programming languages can be found at github.com/saitoha/libsixel with an extensive list of software that can use it (e.g. gnuplot, web browser, even full X11 client). More formal documentation seems to be at vt100.net.
You can probably use it as a poor man's graphics library till you have full GUI/graphics in your Rebol3.
I have made a proof of concept function for myself to convert binary images to sixel encoding but a proper codec(?) would probably be more appropriate. Unfortunately that is above my programming abilities..
I have used code at imgcat.nu as a blueprint. I have kept the inline parameter even though it does not seem to work and the original source always keeps it at 1.
Thank you for your work and wish you all the best!
Beta Was this translation helpful? Give feedback.
All reactions