<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 28 Dec 1991 15:54:54 PST
From   : pallio.UUCP!dg@mis.ucsf.EDU (David Goodenough)
Subject: Graphics standard for small systems?

dave@ips.oz.au (Dave Horsfall) asks:
> Has anyone defined a suitable (portable?) graphics standard for small
> machines?  Things like Sun raster file, X, GIF etc are all very well,
> but a little bit overboard for what I want.

Did you look at the RLE format - it's a nice simple and small monochrome
graphics format. It goes something like this:

ESC G H 

for the first three characters, then black and white color codes to fill
out the entire area of 256 * 192 pixels. The black and white codes
come in pairs, a byte for each value, black first, then white. The
two counts are simply the number of black pixels, followed by the number
of white pixels. Both values are offset by 20h to make them printable,
and the largest legal value is 7fh, encoding 5fh pixels (i.e. 95).

So to output continuous white, you'd say:

20 7f 20 7f 20 7f ..... etc. That'd give zero black, and 95 white
over and over. Note that the picture is filled in from the top
left corner, with lines running from left to right, and lines going
down. Also, if the number of pixels given wont fit on the remainder
of the current line, then simply take the excess and place those on
the start of the next line.

I think the original spec says to ignore values less than 20h, so that
cr/lf pairs can be added for readability. Also, If I were going to send
them as text files, I'd want to see about not using 7f, but making my
maximum value 7e, which _IS_ a printable character ('~'), where 7f
(DEL) is not.

Drop me a line if you want some sample RLE files, and maybe I can also
cook up some C code to convert a RLE file.

                       Yours,
-- 
       dg@pallio.UUCP - David Goodenough               +---+
                                               IHS     | +-+-+
       .....!wet!pallio!dg                             +-+-+ |
AKA:   dg%pallio.UUCP@cs.sfsu.edu                        +---+

<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>