summaryrefslogtreecommitdiff
path: root/imageto/README
blob: 31f228f461ec04fab7c7dede82eaadd062e96473 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
This program extracts the characters from a big image to a GF font file.
Information about the image is given in an ``image font information''
(IFI) file; that file format is described in the documentation.

Currently the program can read the IMG files output by the Scan7650
software, which works with the fancy Xerox 9750 scanner.  (I think IMG
output is used by other GEM applications as well.)  These images are
used by the Interleaf desktop publishing program.  The image format
isn't proprietary, though -- it doesn't have any novel features.  The
message below describes the format.

It can also read PBM files.


Date: Thu, 5 Jul 90 11:22:55 EDT
From: rgw@hq.ileaf.com (Bob Watkins x5545)
To: karl@cs.umb.edu

The image file consists of an OPSHEADER followed by an IMGHEADER, followed
by raster data.  The version field of the OPSHEADER determines which of the
IMGHEADER structures to use.  Most likely this will be 2, but there is a
chance that it might be 1 -- it depends on how recently the software for
that scanner was written.

When reading the headers structures, it is a good idea to read them a field
at a time rather than all at once, since not all compilers use the same
structure padding conventions.

The resolution numbers are in pixels/inch.  Their primary purpose is to
allow TPS to scale the image to the correct physical dimensions when it is
pasted into the document.  Other than that, they aren't that useful.

The flags field should be zero -- there is a stupid marketing reason why it
is there at all, but I won't go into that.

The w and h fields are the width and height of the image in pixels; the d
field is the depth in bits/pixel.  The depth is either 1 or 8, depending on
whether the image is a lineart image or a contone image.

The format field specifies the encoding of the raster data.  A format of 0
means that the data is uncompressed.  The data itself is stored in scanline-
major order.  In the case of lineart image, 8 pixels are packed into each
byte, with most-to-least significant order within the byte representing left-
to-right order in the image.  A 0 bit corresponds to a black pixel, and a 1
bit corresponds to a white pixel.  If necessary, the scanlines are padded out
to the next 16-bit boundary.