imgcat: higher resolution
github.com
github.com
Things are so hard right now in the pandemic and this has given me a little virtual hug.
Big thanks to the eng team at https://charm.sh/ who wrote the terminal library I am using and showed up with prs and great ideas.
If you want to further add vertical resolution, Unicode 13 introduces 2x3 mosaics (from the TRS-80, Teletext and others) that are supported directly within VTE (so people don't need to install a font). Slightly more complicated are the "smoothed" mosaics (from Minitel 2, IIRC) but they offer diagonal lines (and complement PETSCII and ATASCII symbols also introduced in version 13).
I expect 2x4's to be available for version 14, but it'll be a while.
2x3's (and 2x4's) are kind of funny, because you still won't be able to use more than 2 colors per cell, so it works for cells with two colors but that can be subdivided in thirds (or quarters). Finding a best fit for a cell and a mosaic is not a trivial job.
EDIT: ahhh I got it! Before this commit, they printed out two spaces for a single pixel to closer resemble a square, because most terminal fonts are much taller than they're wide. They replaced that by a single character that has one color in the top half and one color in the bottom half. Each of those halves, again, are almost square (HN doesn't let me display the character here, it filters out certain unicode ranges)
[0] https://github.com/trashhalo/imgcat/commit/1f9ef8c888fa93e1e...
edit: it did: two spaces here https://github.com/trashhalo/imgcat/commit/1f9ef8c888fa93e1e...
You could probably solve for it efficiently by computing a small Histogram of Oriented Gradients block, say 3x3, and use that as a hashmap key. Or Sobel filters might be even easier.
While it offers console based interactive exploration of your data you can also get it to just spit out the graph you want.
Is there a reason why the terminals aren't evolving toward that way?
Charts, small images, interactive diagrams, flow charts etc can be more ergonomic when part of the CLI text flow than opened as a separate window.
It's a huge difference.
It is partially done, but the remaining work requires "large amount of code".
https://github.com/torvalds/linux/commit/cec5b2a97a11ade56a7...
[1] https://chromium.googlesource.com/apps/libapps/+/HEAD/hterm/...
You've just got to think of and apply them in the right context.
Most of the world's major breakthroughs are basically just this.
This is something I'd expect to see done by just about anybody along with the full 8th blocks https://en.m.wikipedia.org/wiki/Block_Elements on literally the first day or two of starting this kind of project.
I like positive open source threads sure, but is that what this is about or is there some extraordinary technical details I'm not seeing?
Examples of people being nice to each other in FLOSS projects is certainly something we could always use more of, sure. Is that what this is?
Yes. That's how I interpreted it, at least. (I think it's great)
https://twitter.com/charmcli/status/1320184218794795010
It's interesting to see forgotten lore or techniques reemerge. We (Charm) have just published a TUI framework called Bubble Tea and imgcat was one of the first tools that implemented it, so we were excited to see the progress and help with rendering.
Reminds me that templeOS did bring something interesting to the table that we could probably learn from.. Why shouldn't our terminals be able to show images and video.