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

On Darwin (Mac OS X), brew install imlib2

Note that for Darwin (Mac OS X), you will need to install XQuartz first, the version of the X.Org X Window System (X11) that runs on OS X.

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 standard input:

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

The above commands results the following output in 256-color terminal, see sample.256-color.txt for the actual output:

Output of sample.png

For terminals that support 24-bit color (such as Konsole and Yakuake, see this document for more information about terminals and their color support), 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 amdmi3 avatar atextor avatar livibetter avatar pvdb avatar suve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icat's Issues

Compilation failed on MacOS

I had an error at compilation time with MacOS Ventura, Apple Silicon, homebrew with Imlib2 dependency installed.

% make
cc -c -Wall -pedantic -std=c99 -D_DEFAULT_SOURCE -I/opt/homebrew/include/X11 `pkg-config --cflags Imlib2` -o icat.o icat.c
In file included from icat.c:39:
/opt/homebrew/Cellar/imlib2/1.10.0/include/Imlib2.h:45:10: fatal error: 'X11/Xlib.h' file not found
#include <X11/Xlib.h>
         ^~~~~~~~~~~~
1 error generated.
make: *** [icat.o] Error 1

I modified the Makefile this way :

-       CFLAGS:=$(CFLAGS) -I/opt/X11/include `pkg-config --cflags Imlib2`
+       CFLAGS:=$(CFLAGS) -I/opt/homebrew/include `pkg-config --cflags Imlib2`

Now the compilation is ok ๐Ÿ‘

% make
cc -c -Wall -pedantic -std=c99 -D_DEFAULT_SOURCE -I/opt/homebrew/include `pkg-config --cflags Imlib2` -o icat.o icat.c
cc -o icat icat.o  `pkg-config --libs Imlib2`

Hope it helps...

icat display image in 24 bit

I just came across icat. I am using Arch Linux. I tried displaying an image with icat, but it always displays in 256 colour, instead of 24 bit.
image

My terminal already supports 24 bit colour as can be seen from the following test:

image

I tried searching the internet for enabling 24 bit colour support for icat, but all I could up with is that it is supported by default in icat.
So my question is how do I get the pictures to display in 24 bit colour.

Windows client question

Just a question. I've never used a 256 color SSH client in Windows...I'm trying to use icat to produce 256 color output in an SSH session to my Ubuntu box, running iCat. I tried running ANSICON and plink, but that doesn't look right either. Any suggestions on the environment on a windows box that would look right?

Thanks

with imlib2 dependency installed, the 'make' command failed.

On a Apple Silicon Mac, the make command failed.

โžœ  icat git:(master) pkg-config --libs Imlib2        
-L/opt/homebrew/Cellar/imlib2/1.10.0/lib -lImlib2

So the lmlib2 is installed.

โžœ  icat git:(master) make      
cc -c -Wall -pedantic -std=c99 -D_BSD_SOURCE -I/opt/X11/include -o icat.o icat.c
icat.c:39:10: fatal error: 'Imlib2.h' file not found
#include <Imlib2.h>
         ^~~~~~~~~~
1 error generated.
make: *** [icat.o] Error 1

Please tag releases

Hi!
Can you please tag releases? I want to include this nifty program in the MacPorts tree, and using tags for releases would greatly ease the maintainership :)

Thank you very much!

Package

Are there any plans for making deb/rpm packages?

Add example to README

Would be cool if you could add an example image and its icat output to the README.

Sub-optimal color approximation due to Euclidean metric in RGB

Hi,

The Euclidean metric ( sqrt(a^2+b^2+c^2) ) does not approximate perceived color distance very well. In my version of this project (this seems to be one of these weird wheels everybody keeps reinventing^^) I used the LUV color space, where the Euclidean metric gives somewhat better (though still imperfect) results.

Also, using the ANSI standard palette (colors 0-16) is unwise for image display since users tend to re-define these colors using color themes in their terminal emulators.

Cheers,
jaseg

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.