Is your main Operating System Linux, and do you usually work in the terminal? If so, you are like me, and very likely, you must have wondered how you could view images straight from the terminal without bothering to open an external application.
In short, you should use Yazi. This game-changer application is a terminal-based file manager that you can keep inside your terminal or your favourite terminal editor, Neovim, in my case.
It is not the first application to handle images in this context. Still, it
gathers all existing approaches from a unified interface, choosing one of the different protocols that allow viewing images from the terminal. It should use Chafa, a command-line tool that transforms images into ASCII art as a last resort.
My terminal environment is Alacritty + Zellij, and despite the fact I am far from being fully satisfied with my current solution regarding image visualisation, I am approaching the point where I might stop caring any more. Alacritty is a minimal GPU-enabled terminal emulator, and Zellij is a powerful and customisable terminal multiplexer. Other terminal emulators (kitty, iterm2, etc.) have far more features than Alacritty. Still, I prefer that the multiplexer assumes some of these features so I can have the same experience (and keybindings!) when working from my desktop or via a remote connection (SSH).
The choice of the terminal environment is not gratuitous because you might need to tune some configuration parameters to make Yazi work with images. I will explain what I did in my case.
First, at least on my Ubuntu 24.04 system, I needed to install Überzug++ (a repository and packages are provided). You might have to restart your computer or graphical session. After that, you can see images launching Yazi from Alacritty. However, if you use it along Zellij, you might need some extra work, essentially tricking Zellij into thinking that Neovim is being run, even if it is not there.
If you happen to be a Neovim user, you would also be interested in installing the accompanying Neovim extension. Moreover, you can also choose to replace netwr built-in file explorer with it.
As a last remark, if you experience image misalignment issues when browsing your directory files, ensure that Yazi fits the entire screen. That is the full-screen tab mode in Zellij or by setting floating_window_scaling_factor
in the Neovim plugin (as pointed out here). If some problems persist, it is also possible to fine-tune it at the Überzug++ level with Yazi.
So far, so good. I hope you can enjoy a richer terminal experience this way!