Code Monkey home page Code Monkey logo

icat's Introduction

icat - image cat

Outputs an image on a 256-color or 24-bit color enabled terminal with UTF-8 locale, such as gnome-terminal, konsole or rxvt-unicode (urxvt).

Building

Build requirements: icat depends on imlib2. On Ubuntu, apt-get install libimlib2-dev.

To compile:

make

Running

Run icat with a local file:

icat sample.png

or with multiple files:

icat img1.jpg img2.jpg > newfile.txt

or, if - is used as as file name, it reads from stdin:

curl -sL https://raw.github.com/atextor/icat/master/sample.png | icat -

The above commands would create the following output (note that you have to open this README in a console pager such as `less -r' to interpret the ANSI escape codes that encode the colors):

�[0m�[38;5;25m▄�[0m�[38;5;62m▄�[38;5;110m�[48;5;25m▄�[38;5;189m�[48;5;25m▄�[38;5;7m�[48;5;25m▄�[38;5;7m�[48;5;25m▄�[38;5;189m�[48;5;25m▄�[38;5;110m�[48;5;18m▄�[0m�[38;5;61m▄�[0m�[38;5;18m▄ �[0m �[0m�[38;5;19m▄�[38;5;68m�[48;5;25m▄�[38;5;195m�[48;5;68m▄�[38;5;195m�[48;5;195m▄�[38;5;195m�[48;5;15m▄�[38;5;15m�[48;5;15m▄�[38;5;15m�[48;5;15m▄�[38;5;15m�[48;5;15m▄�[38;5;15m�[48;5;15m▄�[38;5;195m�[48;5;15m▄�[38;5;195m�[48;5;195m▄�[38;5;195m�[48;5;68m▄�[38;5;68m�[48;5;18m▄�[0m�[38;5;18m▄ �[0m �[0m�[38;5;19m▄�[38;5;32m�[48;5;25m▄�[38;5;39m�[48;5;75m▄�[38;5;117m�[48;5;153m▄�[38;5;153m�[48;5;189m▄�[38;5;189m�[48;5;189m▄�[38;5;189m�[48;5;195m▄�[38;5;195m�[48;5;195m▄�[38;5;195m�[48;5;195m▄�[38;5;189m�[48;5;195m▄�[38;5;189m�[48;5;195m▄�[38;5;153m�[48;5;189m▄�[38;5;117m�[48;5;153m▄�[38;5;39m�[48;5;75m▄�[38;5;32m�[48;5;25m▄�[0m�[38;5;24m▄�[0m �[38;5;25m�[48;5;25m▄�[38;5;75m�[48;5;75m▄�[38;5;75m�[48;5;39m▄�[38;5;75m�[48;5;75m▄�[38;5;75m�[48;5;117m▄�[38;5;117m�[48;5;153m▄�[38;5;117m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;117m�[48;5;153m▄�[38;5;117m�[48;5;153m▄�[38;5;75m�[48;5;117m▄�[38;5;75m�[48;5;75m▄�[38;5;75m�[48;5;39m▄�[38;5;75m�[48;5;75m▄�[38;5;25m�[48;5;25m▄�[0m �[38;5;25m�[48;5;25m▄�[38;5;75m�[48;5;75m▄�[38;5;75m�[48;5;75m▄�[38;5;117m�[48;5;75m▄�[38;5;117m�[48;5;117m▄�[38;5;153m�[48;5;117m▄�[38;5;153m�[48;5;117m▄�[38;5;153m�[48;5;117m▄�[38;5;153m�[48;5;117m▄�[38;5;153m�[48;5;117m▄�[38;5;153m�[48;5;117m▄�[38;5;117m�[48;5;117m▄�[38;5;117m�[48;5;75m▄�[38;5;75m�[48;5;75m▄�[38;5;75m�[48;5;75m▄�[38;5;25m�[48;5;25m▄�[0m �[0m�[38;5;25m▀�[38;5;25m�[48;5;74m▄�[38;5;117m�[48;5;117m▄�[38;5;153m�[48;5;117m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;117m▄�[38;5;117m�[48;5;117m▄�[38;5;61m�[48;5;74m▄�[0m�[38;5;24m▀�[0m �[0m�[38;5;25m▀�[38;5;24m�[48;5;68m▄�[38;5;68m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;153m�[48;5;153m▄�[38;5;68m�[48;5;153m▄�[38;5;24m�[48;5;68m▄�[0m�[38;5;18m▀ �[0m �[0m�[38;5;18m▀�[0m�[38;5;61m▀�[38;5;18m�[48;5;110m▄�[38;5;25m�[48;5;153m▄�[38;5;61m�[48;5;153m▄�[38;5;61m�[48;5;153m▄�[38;5;25m�[48;5;153m▄�[38;5;24m�[48;5;110m▄�[0m�[38;5;61m▀�[0m�[38;5;18m▀ �[0m

For terminals that support 24-bit color (only Konsole and Yakuake are known to the authors at the time of this writing), this can be enabled using:

icat -m 24bit sample.png

Author

icat was written by Andreas Textor [email protected]. The sample icon is from the Nuvola icon theme by David Vignoni.

icat's People

Contributors

adamcrume avatar atextor avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.