Operating System - Linux
1748246 Members
3342 Online
108760 Solutions
New Discussion юеВ

Re: Display picture in Command Line Interface

 
SOLVED
Go to solution
Tom Dawson
Regular Advisor

Display picture in Command Line Interface

Hi,

This may be a really off-the-wall question:

Is there a Linux utility that will display a JPG/PNG image from the Command Line Interface. i.e. WITHOUT X-Windows/Gnome/KDE running.

I've seen when Fedora or Solaris boot they display the TUX or Sun Logo at the start of the boot process, even though X-Windows has not started at that poing.

I would like to be able to display our company logo when the boot process is complete or maybe whenever getty/login run.

Thanks,
Tom
7 REPLIES 7
Mel Burslan
Honored Contributor

Re: Display picture in Command Line Interface

Unless you want to do a lot of assembly language programming to show the picture on just the graphic card you have installed on ths machine, you can not do what you are asking.

X-windows is an abstraction layer for you from the graphics hardware. The X-windowing system, figures out the capabilities and settings of the graphic display you have and figures out which pixel to put where on the screen and when you decide to move the image, where it is going to go. WIthout the help of this level of abstration, you need to figure out which pixel on the screen will be which color and write a program to read from jpg file and paint the screen accordingly. Which is not a small adventure in my regards.
________________________________
UNIX because I majored in cryptology...
Tom Dawson
Regular Advisor

Re: Display picture in Command Line Interface

Mel,

Thanks. I was afraid someone was going to say that.

So do Redhat/Sun et al write some assembly or C code to map their logo image onto the screen during boot?

Thanks,
Tom
Kodjo Agbenu
Honored Contributor
Solution

Re: Display picture in Command Line Interface

Hello Tom,

To view images from console without X11 installed, framebuffer can be used. If you are a good programmer, just do it. Otherwise, follow these links and try to find out the right tool :

http://linux.bytesex.org/fbida

http://www.svgalib.org/rus/zgv

Good lcuk.
Kodjo

Learn and explain...
Matti_Kurkela
Honored Contributor

Re: Display picture in Command Line Interface

Linux can use the standard PC display adapters in two possible modes: either in a text mode, or in so-called framebuffer console mode.

There are actually various frame-buffer drivers:
- one for standard VGA. It will work with almost any hardware, but will limit you to the standardized VGA resolutions.
- one for VESA VBE 2.0 compliant display adapters (=most modern ones). It will allow you to use large resolutions and color depths, but does not use any hardware acceleration features.
- various drivers for some specific hardware, whose manufacturers have been kind enough to release the programming specifications to the public.

If your Linux distribution shows the Tux logo in the upper-left corner or a graphic "thermometer" display while Linux boots, your console is already set up in framebuffer mode.

You might not need to roll your own program to display the company logo. Many Linux distributions have at least some utilities that can use the framebuffer mode. A quick search on Debian's package lists (using search terms like "framebuffer", "frame buffer" or "fb*") revealed at least an image display program named "fbi" and a framebuffer-aware getty, "fbgetty". Even some movie player programs can use the framebuffer mode.
MK
Manuel Wolfshant
Trusted Contributor

Re: Display picture in Command Line Interface

dirk dierickx
Honored Contributor

Re: Display picture in Command Line Interface

linux has very nice framebuffer tools available. not only pictures can be shown, but movies as well!
in worst case you can even watch a movie in text mode using the caca library (supported by mplayer for example).
anyway, the last few post above provide enough information on the matter.
for video in the framebuffer you can use vlc - http://www.videolan.org/
Tom Dawson
Regular Advisor

Re: Display picture in Command Line Interface

All,

Thank you very much for the comments. You've given me a lot to research this weekend.

Tom