Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 07-21-2004, 07:14 PM   #1
Registered: May 2004
Distribution: Slackware C
Posts: 274

Rep: Reputation: 30
viewing images in console??

hi people,

the topic is basically my question

is there a prog to view jpg, gif ... in console?

thanks in advance
Old 07-21-2004, 09:12 PM   #2
Registered: Mar 2004
Location: Western Australia
Distribution: Debian Slackware CentOS
Posts: 102

Rep: Reputation: 15
Pretty much no. But if you can open an image up in another program though the CLI if your in a desktop enviroment like this

$ <name of program> image.jpg
$ kuickshow Screenshot.png

thats about it, sorry man.
Old 07-21-2004, 11:11 PM   #3
LQ Newbie
Registered: May 2003
Location: In front of the monitor
Posts: 16

Rep: Reputation: 0
Try seejpeg. Works on more than JPEGs too:

gif, ppm, bmp, tga.
Old 07-21-2004, 11:45 PM   #4
Registered: Sep 2003
Posts: 142

Rep: Reputation: 16
I think mplayer might be able to display images in console.

Old 07-22-2004, 07:53 AM   #5
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 5,388

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
Hello, I did program an image viewer utility in SDL as an exercice, it can display image in console (assuming framebuffer is set)
require :
SDL (provided by sdl official slackware package)
SDL_image (you can get it here : LinuxPackages

Save it as view_image.c
Compile it as :
gcc -o view_image view_image.c `sdl-config --libs` -lSDL_image
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <stdio.h>
#include <stdlib.h>

static SDL_Surface *screen;

void usage( void )
	printf("Usage: view_image image_file\n");
	printf("Display an image. Press <ESC> to exit\n");

int main(int argc, char * argv[])
	SDL_Surface *image;
    SDL_Rect dest;
	SDL_Event event;
	Uint8 *keys;

	char image_path[255];
	int image_type;
	if(argc == 1) {
	strcpy(image_path, argv[1]);

	if(SDL_Init(SDL_INIT_VIDEO) != 0) {
		printf("can't init SDL video: %s\n", SDL_GetError());
		return 1;


	screen = SDL_SetVideoMode(0, 0, 0, SDL_SWSURFACE);
    image = IMG_Load( image_path );
    if ( image == NULL ) {
        fprintf(stderr, "Couldn't load %s: %s\n",
                        image_path, SDL_GetError());
        return 0;
	screen = SDL_SetVideoMode(image->w, image->h, 0, SDL_SWSURFACE );

    dest.x = 0;
    dest.y = 0;
    dest.w = image->w;
    dest.h = image->h;
    SDL_BlitSurface(image, NULL, screen, &dest);

    SDL_UpdateRects(screen, 1, &dest);
	while ( SDL_WaitEvent(&event) >= 0 ) {
		keys = SDL_GetKeyState(NULL);
		if (event.type == SDL_QUIT || keys[SDLK_ESCAPE] == SDL_PRESSED  ) { 
	return 0;
So to view an image in console, just type : ./view_image <image_name>

Last edited by keefaz; 07-22-2004 at 07:56 AM.
1 members found this post helpful.
Old 07-22-2004, 05:59 PM   #6
Registered: Apr 2004
Location: Virginia
Distribution: Slackware 10.1 & 12.0
Posts: 66

Rep: Reputation: 16
image viewer in console

Howdy... have you tried zgv?
good luck


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
viewing jpeg images in kde justwantin Slackware 5 11-15-2005 03:30 PM
Viewing images fom the console dxdad Linux - Software 1 09-29-2004 05:22 PM
Do you relaxe by viewing 1024x768 images? vbp6us General 7 03-29-2003 10:51 AM
viewing images on the command line darkangel Linux - General 3 02-14-2002 10:44 AM
HELP! Viewing .TIFF Images ascii2k Linux - General 0 03-26-2001 10:05 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:54 PM.

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