[comp.windows.x] Help needed; Display integer images on X11

tsatsoul@kuhub.cc.ukans.edu (09/26/90)

I need to display bw, 8-bit images on an X11 color server. Can anybody tell me 
if there is a program that would do so? I know of a program that displays gif
images on color servers, but how do I turn a file of integers into a gif
file?

Thanks,

--- Costas Tsatsoulis
tsatsoul%turing@kuhub.cc.ukans.edu
tsatsoul@kuhub.cc.ukans.edu
tsatsoul@UKANVAX.BITNET

jimf@SABER.COM (09/26/90)

|I need to display bw, 8-bit images on an X11 color server. Can anybody tell me 
|if there is a program that would do so? I know of a program that displays gif
|images on color servers, but how do I turn a file of integers into a gif
|file?

I don't know what you mean by "a file of integers" but my xloadimage
program, now in version 2.0, can display a wide variety of images on a
wide variety of servers.  GIF is one of the supported image formats.

If you want to convert into a graphics format, I'd suggest not using
GIF.  The format is complex enough that it's a pain to write a good
dumper for.  For 8-bit images the Sun rasterfile (standard, not RLE)
is really easy to create and work with.  A sample loader that defines
the Sun format is in sunraster.c in the xloadimage sources.  While the
Sun format doesn't usually use compression as does GIF, I've found
that using it in conjunction with `compress' creates a compact image
file which is easy to deal with.  Somewhere I have a dumper for this
format as well, I might be able to dig it up given a little time.

If you want xloadimage it can be had by anonymous ftp from
expo.lcs.mit.edu in /contrib/xloadimage.2.0.tar.Z.  It will appear on
comp.sources.x in the near future.  If you're unable to get at either
of those sources I can email it to you, but beware that it's 375k of
source in 9 shar files.

Happy hacking,

jim frost
saber software
jimf@saber.com

dbrooks@osf.org (David Brooks) (09/28/90)

In article <25775.26ff771d@kuhub.cc.ukans.edu>,
tsatsoul@kuhub.cc.ukans.edu writes:
|> 
|> I need to display bw, 8-bit images on an X11 color server. Can
anybody tell
|> me if there is a program that would do so? I know of a program that
|> displays gif images on color servers, but how do I turn a file of
integers
|> into a gif file?

As is usual with questinos like this, the answer is "use Jef
Poskansker's excellent PBMPLUS package.

We'll assume you have a <w> x <h> picture, and have w*h integers
between 0 (black) and <m> (white) in the usual L-R, T-B ordering.  If
you don't hack at it until you do.

Edit such a file so that the first three lines read:

	P2
	<w> <h>
	<m>

Now say:

	ppmtogif file-with-integers > file.gif

Magic.
-- 
David Brooks				dbrooks@osf.org
Systems Engineering, OSF		uunet!osf.org!dbrooks
"A Loaf of Bread, a Jug of Wine, and Six Spades Redoubled -- Omar
somebody.