-
Notifications
You must be signed in to change notification settings - Fork 44
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
Unicode block glyphs for 2x2 super resolution trick #29
Comments
This is really amazing. I'll have to take a closer look and see what's necessary to implement it in hiptext. |
|
Happy to answer any questions. It does look quite a bit better than just plain character sized blocks: http://www.blitzcode.net/rust.shtml#term_gfx Forget the Rust-factor as the current code is unusable for production use anyway. Both color quantization and finding the best block character is done by brute-force search, you'd need to implement something smarter there ;-) I only did a PoC implementation as I had no real need for this, was just curious if it could be done. Some fixed-pitch fonts have box drawing / block characters with gaps or users have terminal settings with custom spacing, that might mess up the rendering. But then again, tons of other ncurses style terminal UIs will look equally broken with these settings. |
That's a good point about the alignment of quarter-sized blocks, alignment may not be as consistent across fonts/terminals as single and half blocks. Answering your other points Justine; I think it just looks like ▒ because of the gif compression? The video doesn't have those same artefacts https://www.youtube.com/watch?v=TE_D_fx_ut8 |
The algorithm only works for xterm256. It doesn't work in However for true color, quantization isn't necessary, so the algorithm could be circumvented entirely.
Makes sense. One thing worth mentioning: years ago I looked into using that dot block to perform shading to get in-between colors. Color mixing is actually a very interesting problem. Our eyes perceive colors in a way that's very different from how they're represented in computer memory. I tried using Kubelka Munk color mixing which AFAIK represents the latest research. It helped. But it still looked ugly. So I ended up not going down that road. |
You hand-sampled 256 foreground and another 256 background colours!!? My god. And Kubelka Munk colour mixing, I was vaguely aware of the theories, but had no idea that particular paper was from all the way back in 1931! |
@blitzcode has come up with an ingenious method to get 2x2 resolution per character! It's in rust, but still, worth bearing in mind that it's possible.
https://github.com/blitzcode/term-gfx/blob/master/src/main.rs
That code also supports true colour terminals, aka, 16 million colours.
The text was updated successfully, but these errors were encountered: