Use lsix to make the Linux command line display pictures

Original link: https://blog.kelu.org/tech/2023/08/04/displaying-images-in-the-linux-command-line.html

Some pictures are stored on the server, and it is troublesome without preview.

To be able to preview on the command line, a prerequisite is that the terminal supports Sixel Graphics. Like I use iTerm2, there is no problem with the server-side preview. But if you enter tmux, it will not work.

  1. Install ImageMagick

    Ubuntu/Debian

     sudo apt-get install imagemagick

    macOS

     brew install imagemagick
  2. install lsix

     wget https://raw.githubusercontent.com/hackerb9/lsix/master/lsix sudo mv lsix /usr/local/bin sudo chmod +x /usr/local/bin/lsix
  3. use

     lsix 

    image-20230816103829510

    If the terminal or server does not support it, it will be displayed as follows:

    image-20230816103916037

This article is transferred from: https://blog.kelu.org/tech/2023/08/04/displaying-images-in-the-linux-command-line.html
This site is only for collection, and the copyright belongs to the original author.