[comp.sys.atari.st] GEM VDI image file format

hannu@tut.UUCP (08/19/87)

Hi there !

I downloaded two postscript conversion programs from uh-info@uhupvm1.
a) 1ST2PS, which converts 1STword -files to postscript

b) NMFPS, which converts .gem -files (gemDraw /easyDraw) to postscipt

Both worked quite nicely , no problems. Then i got an idea to make
cnversion- program for image (.img) -files ( for ex. GemPaint).
If you have the bit image, then conversion to postsrcipt in quite easy.
This can be done easily with for ex. DEGAS -files.The .img files are
not so easy. They are encoded ( file format appendixed)

But...   the testfile didn't look like it should have been (not at all)
I might be that  the file format has been changed (and I have an old version
manual). Does anyone know if file format is revised or if there are bugs
in manual

Hannu Koivisto        hannu@tut.fi      (internet style address)
	         ...!mcvax!tut!hannu    (old uucp -style)		
                    koivisto@fintuta.bitnet  (also via bitnet)

===================== bit image file (.img) format ========================

from: GEM Programmers Guide, VOL 1: VDI (old version?)

HEADER FORMAT	The bit image file header consists of sixteen WORDS (two
		bytes ?)

		Word 		   contents
		 0		upper left x of bit image
		 1		upper left y
		 2		lower right x
		 3		lower right y
		 4		source device page width
		 5		              page height
		 6		source device pixel widht in microns
		 7				    height
		 8		bits per pixel
		 9 - 16		reserved for future use (zero)
Rem! sixteen or seventeen words ??


DATA FORMAT	Pixel data may be encoded in any of four formats, which may
		occur within the same bit image file
		- run-length encoding (default)
		- extended run-length encoding
		- raster encoding
		- raster-run encoding

Run-length packet:	byte 0	run length   ( < 128 )
			byte 1  color index    < 256

Extended packet:        byte 0  opcode = -1
			byte 1  extended run length  ( ie. *128 pixels)
			byte 2  color index

Raster packet:		byte 0  opcode= -2
			byte 1  number of pixels in stream
			byte 2  packed color indices
			...               ( rem! bits/pixel )

Raster-run packet:	byte 0  opcode= -2
			byte 1  pattern repeat count
			byte 2  number of pixels in stream
			byte 3  packed color indices
			...
=============================================================================
-- 
mina se olen