Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-22-2004, 02:11 AM   #1
Registered: Jan 2004
Distribution: CentOS
Posts: 281

Rep: Reputation: 30
View image from command line?

This may sound strange,

I'm wondering if there's a line command/utility type thing that will let me view an image on the command line. Obviously, I don't mean perfectly rendered- but like ASCII art or something. This actually would be very handy for webservers, when you just want to see which image is which and you can't tell from the filename. From the ascii you could tell if it's a title or a photograph, without having to (start the webserver and) lookup each one in the browser.
Old 03-22-2004, 02:51 AM   #2
Registered: Jul 2001
Location: California, US
Distribution: Slackware
Posts: 196

Rep: Reputation: 30
there are tools which will convert images to other formats such as jpg to png to ascii, a script i have on my slackware machine to do that is:

/usr/bin/djpeg <file> | /usr/bin/ppmtopgm | /usr/bin/pgmtopbm | /usr/bin/pbmtoascii -2x4

or for gifs:

giftopnm LinuxQuestions.gif | pnmtojpeg | djpeg | ppmtopgm | pgmtopbm | pbmtoascii -2x4

you can substitute -2x4 with -1x2 for different sizes. But even still, this will output to a much larger scale than a normal 80 character width of the standard console. Converting the small logo at the top of the page converts to take up the entire width of my 1600x1200 screen at the smaller -2x4 size and both of my dual monitor 3200x1200 resolution at -1x2. Of course these are from the tools installed from a full slackware 8.0 install, it will most likely be different for your distribution, but this will hopefully give you a good idea of what to do. You if its a jpeg just type like jpg<tab><tab> to find something it could convert to and keep doing this until you can convert it to the desired format.

This resolution to the problem is something I came up with like 2 years ago and I've heard of lots of other ways to convert images to ascii since then, but this is the only way I remember of doing it purely from the command line.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Line Image Editing fractal_chaos Linux - Software 8 10-03-2005 05:33 PM
Any command-line tools which can edit EXIF image data? neocookie Linux - Software 1 01-27-2005 11:23 AM
Command line question - creating ISO image satimis Linux - General 8 09-25-2004 03:18 AM
Command line utlility to view user info like the GUI one? ivj Linux - Newbie 1 07-27-2004 06:44 AM
Boot to different image from command line markb Linux - General 8 04-06-2003 08:32 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration