How to display images in OSX terminal

12,724

Solution 1

  • xdg-open to open a viewer from terminal
  • convert to ascii art asciiview
  • use vlc to output video as ascii art

Solution 2

pxl is the best tool I have found for xterm-256color terminals.

iTerm has specific tools to inline images (search iTerm imgcat and imgls) but those are kind of cheats (that work great :D).

gif-cli works for GIFs, but ... not well at all. Its author has tools for videos and images, too.

pxl:

enter image description here

imgcat: Just shows the image, with no scaling or anything. The screenshot was bigger than SO's limit, unfortunately. (SO should include a compression mechanism. 🙄) Supports a variety of formats, including animated GIFs.

Update: Kitty is a cross-platform terminal emulator that supports custom protocols that allow it to render bitmaps. It's very feature-rich, I suggest you try it.


Share:
12,724

Related videos on Youtube

John Militer
Author by

John Militer

All my code contributions are licensed to you under CC0, unless otherwise noted in the post. This means that you can use any of my code contributions without attribution or permission.

Updated on September 18, 2022

Comments

  • John Militer
    John Militer almost 2 years

    How do I display images in the terminal? I am on Mac OSX mountain lion (10.8.5), and the answers in this question don't work on OSX. Is it possible at all?

  • ctrl-alt-delor
    ctrl-alt-delor about 8 years
    Have you installed them. I know 100% that you can get vlc for mac.
  • Wildcard
    Wildcard about 8 years
    @John, if you want to just use existing Mac tools without installing anything, why not just use the terminal command open on the image files to open them in Preview?
  • John Militer
    John Militer about 8 years
    I would like to install available tools to do that. Please tell me the url's for them
  • ctrl-alt-delor
    ctrl-alt-delor about 8 years
    I use apt-get and these URLs: http://ftp.uk.debian.org/debian/. If you are using Mac, or Microsoft, then you have to do it the hard way (does mac have a package manager?)
  • jamescampbell
    jamescampbell over 5 years
    pxl is my new favorite, really nice go get away install too. Thanks