50 comments

[ 3.3 ms ] story [ 108 ms ] thread
Or use iTerm2 and get as much resolution as you want:

https://iterm2.com/features.html#inline-images

iTerm2 is only available for macs right? imgcat can work with any terminal that is able to display colored characters.
Why are you still using a Mac?
can't speak for OP but I use the computer work gives me most of the time, which is a mac
I’ll bite. No other platform has the same level of integration and tool quality. There is no real remplacement for iTerm and Preview. There is no real equivalent of air drop, handoff (copy paste, pulling OTPs from sms, scan through phone...). TouchId that works, unlock with watch. For people in the Apple ecosystem the competition would have to get a lot better and the iOS/macOS a lot worse to be worth a switch.
> I’ll bite.

The better answer to obvious trolling is downvoting/flagging and moving on. Feeding the troll only derails the thread.

Eh. Haven't used Windows in 15 years and don't intend to in the future either. Linux would require a whole lot of fiddling (if I'd even managed to find a laptop with good hardware and hardware support to begin with). Macs have excellent hardware (yes you pay a premium for it). Good battery life. Good keyboard (up to 2015 models at least). Great touch pad (hardware and driver wise). MacOS has a good window manager, excellent applications like iTerm2 and Alfred that I wouldn't want to live without and would have to find subpar Linux replacements for. This sucks a bit since I've generally tried to keep to cross-platform apps and because of these I'm a bit locked in.

Oh and the consistent keyboard shortcuts across the OS (terminal included) with Cmd is soooo nice.

That said I'm using 2015 models (Air and Pro) as the newer ones haven't impressed me at all (had an MBP with touch bar for a year or so). Love the Magsafe power connector (which just gracefully disconnects when you rough it) and don't want to switch to USB-C and its adapter hell.

Once it's no longer possible to find proper 2015's anymore I might want/have to consider switching back to Linux (and spend a lot of time fiddling with everything), but we're far from there still - I recently bought a 2015 MBP with new battery for €800.

Edit: Unlike one other poster here I loathe iOS and think it's horrible (had an iPhone for a year so have some hands on experience) so I don't use features like AirDrop or handoff (even though it's super convenient between two Macs). And he mentions Touch ID which was actually brilliantly convenient on the newer MBP I had, but that's not unique to Macs. So yeah, the more you lock yourself into the Apple ecosystem the more benefits you get, but I've tried to explicitly not do that.

Thank you for taking you time. It's good to know other people perspective.
Question: are there any charting libraries based on the same principles?
Visidata is pretty cool - https://www.visidata.org/

While it offers console based interactive exploration of your data you can also get it to just spit out the graph you want.

If we finally (at 2020) get some sort of stable image capability to the terminal, we can start to have a lot of charting or other creative capabilities incorporated into CLI tools instead of the ancient way of drawing by characters.

Is there a reason why the terminals aren't evolving toward that way?

What would be the difference then with a plain X (or wayland) app launched from the terminal ?
You can run from any platform on a remote server without GUI support?

It's a huge difference.

Ergonomics.

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.

Here is the commit in case anyone is interested: https://github.com/trashhalo/imgcat/commit/1f9ef8c888fa93e1e...
I don't understand it. It appears to split pixels in two (check the special unicode ascii art character on line 142[0]), not in four as the screenshot would suggest. Is that special character half-width in certain terminals, or something?

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...

Isn't this a 35 year old trick? I could have sworn I've known about it for at least 25
Lots of tricks are old.

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.

what I mean is I don't understand why the post is significant.

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?

> 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)

Yep, it was used in ansi graphics on BBSes back in the day
Hi! I made imgcat. I wanted to say how wonderful it is to wake up and find myself on the front page of hackernews.

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.

That's really cool!

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.

Symbols for Legacy Computing (Range: 1FB00–1FBFF) would be a helpful block to look at as a possible optional even-higher-fidelity mode. Has all kinds of slopes that you could better approximate edges with.

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.

Curious, what are people using this for?
I love the run-around time between idea, implementation, release! Great job.
This is really cool.

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.