LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-13-2008, 11:50 PM   #1
baldurpet
Member
 
Registered: Dec 2008
Location: Iceland
Distribution: Ubuntu, freeBSD
Posts: 110

Rep: Reputation: 15
Odd request, how to view images in Terminal (as ASCII, or etc.)?


This might seem like a fairly odd request so I'm not sure whether anybody knows the answer to it, but I had this little silly idea whether I could display rough images I have in a terminal or in the TTY[1-6] (I forgot what they're called, the big full-screen terminals that appear when you push <CTRL>+<ALT>+[1-6])?

I'm thinking about both being able to look at pictures in a web browser (the only one I know is w3m which I only figured out yesterday and the only thing I know how to do is w3m <url> so that is really basic), and being able to look at something like .jpg or .png images, in a kind of ASCII like manner. I mean the terminal can display colour (like when you use the top command and then push z) so is it really so crazy to be able to display some (albeit extremely raw) graphics?

Please respond, because this sounds like a wonderfully interesting feature (especially to show off to your friends)- if it exists

Last edited by baldurpet; 12-14-2008 at 12:04 AM.
 
Old 12-14-2008, 12:39 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Displaying graphics on a pixel-oriented display is quite different from displaying text on a character-cell based display. The ability to display color is only a small part of what is required to render a bitmapped image.

There are the old-fashioned images generated by using character cells as pixels, where various characters having different 'densities' were used to create images in a monochrome. These were generally rendered on dot-matrix or dasiy wheel printers, in order to get enough character cells to produce an image. This could be done without too much difficulty now, simply by using a lookup table to translate pixel colors into characters, as the rendering part of a bitmap display algorithm.

Also done with character cell text is the so-called ASCII-art. This technique exploits the shape of certain characters, and the way certain characters are able to 'join' other characters to produce shapes. The name ASCII-'art' is appropriate for this, as it would be very difficult (and by 'very', I mean near impossible) to algorithmically translate bitmapped images to this form of display.

--- rod.
 
Old 12-14-2008, 12:57 AM   #3
baldurpet
Member
 
Registered: Dec 2008
Location: Iceland
Distribution: Ubuntu, freeBSD
Posts: 110

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by theNbomr View Post
Also done with character cell text is the so-called ASCII-art. This technique exploits the shape of certain characters, and the way certain characters are able to 'join' other characters to produce shapes. The name ASCII-'art' is appropriate for this, as it would be very difficult (and by 'very', I mean near impossible) to algorithmically translate bitmapped images to this form of display.
What about JPEG to ASCII?
 
Old 12-14-2008, 04:28 AM   #4
doc.nice
Member
 
Registered: Oct 2004
Location: Germany
Distribution: Debian
Posts: 274

Rep: Reputation: 34
there is "fbi" to show images on the terminals as long as you have a framebuffer loaded,
simply try "fbi somefile.jpg".

another way would be to use the aalib (ascii-arts) to generate an ascii-representation of the image "as text".
 
Old 12-14-2008, 10:42 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by baldurpet View Post
What about JPEG to ASCII?
Your cited URL isn't what most would call ACII-art, but does exemplify what I also described in my post. The character cells are like pixels, and the color depth of the pixel is given by the relative density of the character placed in the cell. It may be worth noting that this requires the use of pixed-pitch fonts.
--- rod.
 
Old 12-14-2008, 06:04 PM   #6
baldurpet
Member
 
Registered: Dec 2008
Location: Iceland
Distribution: Ubuntu, freeBSD
Posts: 110

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by theNbomr View Post
Your cited URL isn't what most would call ACII-art, but does exemplify what I also described in my post.
Well I wasn't really expecting any 'artistic' value of of my terminal I think I found jp2a by simply using apropos ascii and browsing through the output. And even though the fbi program that doc.nice recommended is far better in terms of quality, I kind of like jp2a better It's much cooler to open pictures using ASCII-"art" than just regularly

That only problem is, that I can't seem to get the colours working in jp2a. Has anyone here used that program? Is it possible to:
  • Flip between images using the left and right arrow buttons? It seems like that isn't possible, but that would be so much easier not to have to input the filename every time.
  • Make the colours better? I only manage to get like 4 colours and it looks almost worse than it does in black and white
  • Make the characters smaller; that is to say to make the resolution better?
  • (also), what is the TTY1 through 6 called?
I want to find a sort of middle way between fbi and jp2a which has the charm and coolness of ASCII but some of the quality of a regular viewer. I might be asking for too much, but that would really make my day

Last edited by baldurpet; 12-14-2008 at 06:07 PM.
 
Old 12-14-2008, 10:48 PM   #7
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by baldurpet View Post
This might seem like a fairly odd request so I'm not sure whether anybody knows the answer to it, but I had this little silly idea whether I could display rough images I have in a terminal or in the TTY[1-6] (I forgot what they're called, the big full-screen terminals that appear when you push <CTRL>+<ALT>+[1-6])?
  • to display color images without X use zgv. This won't display them as ascii-art.
  • To display colorful images as ascii-art use cacaview, but it supports limited only *.bmp.
  • to display movies as ascii art use aaxine, "mplayer -vo aa" or "mplayer -vo caca".
  • There was another program for displaying images as greyscale ascii art, but I forgot its' name. It was called aview or aaview.

Quote:
Originally Posted by baldurpet View Post
I'm thinking about both being able to look at pictures in a web browser (the only one I know is w3m which I only figured out yesterday and the only thing I know how to do is w3m <url> so that is really basic), and being able to look at something like .jpg or .png images, in a kind of ASCII like manner. I mean the terminal can display colour (like when you use the top command and then push z) so is it really so crazy to be able to display some (albeit extremely raw) graphics?
"links" browser version 2 can display websites with images using svgalib or framebuffer, without X.
 
  


Reply

Tags
ascii, image, terminal, tty, viewer, w3m



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
view .php images ggeo Debian 3 03-21-2007 06:26 PM
Whole GUI Can't View Images laxisusous Linux - General 3 09-20-2006 07:17 AM
feedback request for public images of grub aus9 General 4 03-14-2006 07:21 AM
is there a way to view images without X? pyenos Linux - Software 2 03-09-2005 07:19 AM
Gnome Terminal - Extended ASCII Display Girl Geek Linux - Software 1 11-17-2004 10:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:07 AM.

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