<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=IMG_file</id>
	<title>IMG file - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.temlib.org/AtariForumWiki/index.php?action=history&amp;feed=atom&amp;title=IMG_file"/>
	<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=IMG_file&amp;action=history"/>
	<updated>2026-07-27T02:36:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=IMG_file&amp;diff=14276&amp;oldid=prev</id>
		<title>&gt;Wongck at 12:04, 11 October 2011</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=IMG_file&amp;diff=14276&amp;oldid=prev"/>
		<updated>2011-10-11T12:04:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:04, 11 October 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l592&quot;&gt;Line 592:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 592:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Back to [[Pictures_Files]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Back to [[Pictures_Files]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br /&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br /&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br /&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Data Formats]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>&gt;Wongck</name></author>
	</entry>
	<entry>
		<id>https://www.temlib.org/AtariForumWiki/index.php?title=IMG_file&amp;diff=14275&amp;oldid=prev</id>
		<title>&gt;Zorro 2 at 11:56, 24 October 2006</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=IMG_file&amp;diff=14275&amp;oldid=prev"/>
		<updated>2006-10-24T11:56:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
                   Understanding color IMGs&lt;br /&gt;
                      A novel by Dr. Bob&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                      27 September 1992&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            IMG file formats, bi-level and color.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 The IMG standard from DRI is composed of a file header and &lt;br /&gt;
encoded (or not encoded) bit-image data. &lt;br /&gt;
&lt;br /&gt;
 Bi-level, or monochrome, IMGs have a very straight forward&lt;br /&gt;
and efficient storage method. In fact, the compression ratio&lt;br /&gt;
is about the best around for non-LZW compression (GIFs and&lt;br /&gt;
some TIFFs use LZW to achieve quite a great compression ratio).&lt;br /&gt;
 &lt;br /&gt;
 Bi-level IMGs have been in widespread use for quite a while&lt;br /&gt;
but with the advent of color video systems, the IMG standard&lt;br /&gt;
has become bogged down.  This is due, primarily, to the vague-&lt;br /&gt;
ness in the description of the IMG file format concerning &lt;br /&gt;
storage of the color data (both the color palette and the color&lt;br /&gt;
bitimage itself).&lt;br /&gt;
&lt;br /&gt;
 Since GEM has taken a rather backseat position in the computing&lt;br /&gt;
world today, it is doubtful that DRI will assist in clarifying&lt;br /&gt;
the issue.&lt;br /&gt;
 And since it can be said that ATARI is the last real GEM strong&lt;br /&gt;
hold in the computing world (being that the ST's operating&lt;br /&gt;
system is designed in its entirety around GEM), it would seem a&lt;br /&gt;
rather natural step that they (Atari) take some step or steps&lt;br /&gt;
to either publish a standard or at least a suggestion for a&lt;br /&gt;
standard for color IMG graphics.&lt;br /&gt;
 Alas, this has not happened. In all the seven years since the&lt;br /&gt;
ST came into being, no color IMG format has gelled into a stan-&lt;br /&gt;
dard.&lt;br /&gt;
 Several vendors have designed both legal and illegal variations&lt;br /&gt;
of the IMG standard in order to support color but in the end,&lt;br /&gt;
all that has come into being is incompatibility.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 This document will describe four different renditions of color&lt;br /&gt;
IMG formats (variations on a theme, you might say). A fifth, which&lt;br /&gt;
has been discovered but not yet disected, will be appended at a &lt;br /&gt;
later date.&lt;br /&gt;
&lt;br /&gt;
 Names will be given to discern one version from another. These&lt;br /&gt;
names are not intended to detract from anyones rights or give any &lt;br /&gt;
privileges to anyone, but simply to keep some  clarity amist the&lt;br /&gt;
confusion.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 First we'll examine the normal bi-level IMG format to give us&lt;br /&gt;
a basis for later comparison.&lt;br /&gt;
&lt;br /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
GLOSSARY insert:&lt;br /&gt;
&lt;br /&gt;
BI-LEVEL: Two colors. Usually meant to be black and white (B/W).&lt;br /&gt;
         This is often called monochrome although 'monochrome' can&lt;br /&gt;
         also imply shades of grey. Bi-Level is a more accurate &lt;br /&gt;
         description of the black-n-white imagery we're concerned&lt;br /&gt;
         with in this document.&lt;br /&gt;
&lt;br /&gt;
TOKEN:    Used in uncompressing a file. A code, usually only a byte,&lt;br /&gt;
         that indicates the start of a compression scheme.&lt;br /&gt;
         For IMGs, there are four different tokens:&lt;br /&gt;
         $80=Bit-string, $00=Pattern-run, $00+$ff=VRC (note: two bytes)&lt;br /&gt;
         and there is Solid-run which is any other value not listed&lt;br /&gt;
         above.&lt;br /&gt;
&lt;br /&gt;
WORD:     A 16-bit value, taking up two bytes of space. The order &lt;br /&gt;
         is Motorola Hi-Lo. (on other systems, the order may be&lt;br /&gt;
         reversed to lo-hi)&lt;br /&gt;
         Sample:  256 = hex $0100  $01,$00&lt;br /&gt;
                  128 = hex $0080  $00,$80&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DRI:      Abbreviation of Digitial Research Inc., the owner of&lt;br /&gt;
          GEM (Graphic Enviornment Manager) and its parts&lt;br /&gt;
          such as AES, VDI etc      &lt;br /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The standard DRI IMG file header is comprised of eight (8) words:&lt;br /&gt;
&lt;br /&gt;
               word offset  typical   description&lt;br /&gt;
               --------------------------------------&lt;br /&gt;
                0    $00     $0001    IMG version&lt;br /&gt;
                1    $02     $0008    Header length *&lt;br /&gt;
                2    $04     $0001    Number of planes&lt;br /&gt;
                3    $06     $0002    Pattern def len&lt;br /&gt;
                4    $08     $0055    Microns width&lt;br /&gt;
                5    $0A     $0055    Microns height&lt;br /&gt;
                6    $0C     $0280    Image width&lt;br /&gt;
                7    $0E     $0190    Image height&lt;br /&gt;
               --------------------------------------&lt;br /&gt;
 &lt;br /&gt;
 Let's examine each of these.&lt;br /&gt;
 &lt;br /&gt;
IMG version:&lt;br /&gt;
&lt;br /&gt;
 This denotes the version of the IMG file format. It is always&lt;br /&gt;
 one (1), by DRI's specification. No other IMG version has ever&lt;br /&gt;
 been designed (or authorized)&lt;br /&gt;
 see: XIMG also&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
HEADER length:&lt;br /&gt;
 &lt;br /&gt;
 This is, slightly, a misnomer since it alludes to the LENGTH&lt;br /&gt;
of the header. It is actually the number of WORDS in the header,&lt;br /&gt;
so it may be more accurate to term this: HEADER COUNT&lt;br /&gt;
 All bi-level images have an 8 in this word, meaning that there&lt;br /&gt;
are 8 words in the header.  The value found here for color images&lt;br /&gt;
will vary depending mainly on the size of the palette and also&lt;br /&gt;
the particular color IMG rendition.&lt;br /&gt;
&lt;br /&gt;
note:  since the palette is stored within the header of the IMG&lt;br /&gt;
       file, HEADER COUNT includes the palette data as well as&lt;br /&gt;
       the standard header.&lt;br /&gt;
       &lt;br /&gt;
       Close attention must be paid to this word when working&lt;br /&gt;
       with color IMG files since it is the only way we have&lt;br /&gt;
       to determine the start of the image data.&lt;br /&gt;
       With bi-level IMGs it was safe to assume that all IMG&lt;br /&gt;
       file headers were fixed at 8 words. An assumption like&lt;br /&gt;
       this can be dangerous when working with color IMGs.&lt;br /&gt;
       Always determine the header length from this word.&lt;br /&gt;
       &lt;br /&gt;
              the start of the image is found using:&lt;br /&gt;
       &lt;br /&gt;
             IMAGE_START = Filestart + (HEADER_LEN*2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Number of PLANES:&lt;br /&gt;
&lt;br /&gt;
 This is, as it seems, the number of planes in the image.&lt;br /&gt;
Bi-level (mono) images have, of course, only one plane.&lt;br /&gt;
 This word also dictates, as one would assume, the number of&lt;br /&gt;
colors in the image. An image with 4 planes has 16 colors and&lt;br /&gt;
an image with 8 planes has 256 colors.&lt;br /&gt;
&lt;br /&gt;
               NUMBER COLORS =  2^PLANES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PATTERN DEFINITION length:&lt;br /&gt;
 &lt;br /&gt;
 This word is only of importance for one of the compression&lt;br /&gt;
techniques in the IMG specification from DRI. Some authors&lt;br /&gt;
may use it and some may not.&lt;br /&gt;
&lt;br /&gt;
 It specifies the size of patterns for the token PATTERN-RUN,&lt;br /&gt;
and is usually either one (1) or two (2) but can, in all&lt;br /&gt;
legality, be ANY number. You'll find, however, that it is&lt;br /&gt;
usually an EVEN number when it's higher than 1.&lt;br /&gt;
&lt;br /&gt;
 A 1 means that the pattern to be duplicated is one byte in&lt;br /&gt;
length or 8-bits. A 2 means the pattern is two bytes wide, 4&lt;br /&gt;
means it is four bytes wide and so on.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
MICRONS, words 4 and 5:&lt;br /&gt;
&lt;br /&gt;
 MICRONS denote the actual size of the pixels.&lt;br /&gt;
 They can be teeny tiny dots or they can be huge. Many authors&lt;br /&gt;
 may choose to ignore this (and many do) since it is common&lt;br /&gt;
 practice to treat one dot as one video pixel.&lt;br /&gt;
 Also of interest here is the fact that both WIDTH and HEIGHT&lt;br /&gt;
 are specified. This means that the pixels may not necessarily&lt;br /&gt;
 be square (equal in width and height).&lt;br /&gt;
 This is often the case when the image is based on a particular&lt;br /&gt;
 video resolution such as Atari/ST Medium resolution or the PC's&lt;br /&gt;
 2-color resolution or any other resolution where the aspect is&lt;br /&gt;
 not 1:1 (the TT's low rez comes to mind also).&lt;br /&gt;
&lt;br /&gt;
                    DPI = (25,500/MICRONS)&lt;br /&gt;
                    MICRONS = (25,500/DPI)&lt;br /&gt;
&lt;br /&gt;
                     85 MICRONS = 300 DPI&lt;br /&gt;
                    255 MICRONS = 100 DPI&lt;br /&gt;
       &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 And finally, image WIDTH and HEIGHT: words 6 and 7&lt;br /&gt;
&lt;br /&gt;
 Width is specified in number of pixels and height, of course,&lt;br /&gt;
 is the number of lines (or rasters).&lt;br /&gt;
&lt;br /&gt;
 Although the width is stated in number of pixels, the image&lt;br /&gt;
only stores whole bytes. If the image WIDTH is 633 pixels then&lt;br /&gt;
80 bytes are stored. 79 full bytes and one last byte of which&lt;br /&gt;
only 1 bit contains any information. The other 7 bits are not&lt;br /&gt;
valid image data and may be be blank, filled or totally garbage.&lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               A note on IMG compression methods:&lt;br /&gt;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 Although this document does not go into detail on the different&lt;br /&gt;
compression methods used, there are some details which are&lt;br /&gt;
important and that are not mentioned or not clearly stated in the&lt;br /&gt;
normal channels.&lt;br /&gt;
&lt;br /&gt;
 All and any compression ends at each raster boundary. In other&lt;br /&gt;
words: each raster is compressed individually.&lt;br /&gt;
Pattern runs, byte strings, bit runs all end at the end of each&lt;br /&gt;
raster. Each new raster, if compressed, starts a fresh compression&lt;br /&gt;
sequence. There is no overrun from one raster to another.&lt;br /&gt;
&lt;br /&gt;
 Although it up to the author which compression functions to use,&lt;br /&gt;
it is necessary for an IMG reader to expect a VRC function (even&lt;br /&gt;
though one particular IMG may or may not contain one).&lt;br /&gt;
Always assume that an absence of any VRC (or VRC=0) is the same&lt;br /&gt;
as VRC=1.&lt;br /&gt;
 This will avoid confusion. Since a VRC of 1 does NOT mean to&lt;br /&gt;
repeat the raster 1 time but means only to write the raster once.&lt;br /&gt;
 Actually, a VRC code of 1 (one) is completely unecessary in any&lt;br /&gt;
IMG. If this is encountered it is probably due to a fluke in the&lt;br /&gt;
authors encoding technique and/or a lack of clarity in his/her&lt;br /&gt;
source of IMG documentation.&lt;br /&gt;
 This is not to say that a VRC of 1 is in any way illegal. Quite&lt;br /&gt;
the contrary, it is completely legal; just not a necessesity. &lt;br /&gt;
&lt;br /&gt;
-----------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                *** COLOR IMG FORMAT VARIATIONS ***&lt;br /&gt;
 &lt;br /&gt;
  &lt;br /&gt;
 It can be said that there is only one IMG format in existance.&lt;br /&gt;
While this is technically true, it is more a case of semantics&lt;br /&gt;
than an actual real-life truth.&lt;br /&gt;
&lt;br /&gt;
 If there were only one IMG format then there should be no com-&lt;br /&gt;
patibility problems with any color IMG file and any application&lt;br /&gt;
that attempts to access that color IMG file.&lt;br /&gt;
 Sadly, that is not the case. While there may be only one FORMAT,&lt;br /&gt;
there is certainly an abundance of color 'dialects'.  Each of&lt;br /&gt;
which is just different enough to cause woes to the end user.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
            What can be so difficult in establishing&lt;br /&gt;
                 a standard color IMG format?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
               The main areas of contention are:&lt;br /&gt;
 &lt;br /&gt;
             1) color palette, what type of system&lt;br /&gt;
             2) arrangement of the bit image planes&lt;br /&gt;
&lt;br /&gt;
          A third item has arisen due to the existance&lt;br /&gt;
                  of the different 'dialects'&lt;br /&gt;
&lt;br /&gt;
             3) How to discern one type of color&lt;br /&gt;
                IMG file from another.&lt;br /&gt;
&lt;br /&gt;
           -  -  -  -  -  -  -  -  -  -  -  -  -  -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                     1) COLOR PALETTE:&lt;br /&gt;
                        a) where&lt;br /&gt;
                        b) what kind&lt;br /&gt;
&lt;br /&gt;
 DRI specified no particular method for storing the color palette.&lt;br /&gt;
 Nor did they say where it should be stored.&lt;br /&gt;
&lt;br /&gt;
                         A) where&lt;br /&gt;
 &lt;br /&gt;
 Every color 'dialect' design has, quite curiously, chosen the best&lt;br /&gt;
method as to where to store the palette data. It is placed directly&lt;br /&gt;
after the normal file header and the HEADER LENGTH word is adjusted&lt;br /&gt;
to include this palette data.&lt;br /&gt;
&lt;br /&gt;
              Conclusion:  no problem here.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                         B) kind of color&lt;br /&gt;
&lt;br /&gt;
 HOW should the palette be stored? This question arises since the&lt;br /&gt;
ST community has for a long time used and has grown accustomed to&lt;br /&gt;
the fixed size files of DEGAS, TINY and NEO.&lt;br /&gt;
 When authors then started to design color IMGs they naturally&lt;br /&gt;
carried over some of their learning, namely the palette. &lt;br /&gt;
 These DEGAS, TINY and NEO files used a palette that is similar&lt;br /&gt;
to the palettes of other computer systems but with the Atari ST&lt;br /&gt;
specific word sized colors.&lt;br /&gt;
 This is commonly called a 'hardware' or, in the ST community,&lt;br /&gt;
the 'XBIOS' style of palette.&lt;br /&gt;
 Since we're working with DRI's IMG file format, it is natural to&lt;br /&gt;
assume that the color palette also be stored as a DRI standard may&lt;br /&gt;
or might be. So, other authors decided to, instead, store the&lt;br /&gt;
palette as the VDI portion of GEM would expect it.&lt;br /&gt;
 Both methods have their advantages.&lt;br /&gt;
The XBIOS method lends itself to easy porting of other file formats&lt;br /&gt;
since it is directly hardware oriented and can be efficiently and&lt;br /&gt;
quickly converted to VDI colors.&lt;br /&gt;
 The VDI method, while portable with a little extra effort, does&lt;br /&gt;
not require any modification for use in a VDI enviornment.&lt;br /&gt;
&lt;br /&gt;
             Conclusion: incompatible palettes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                    2) BIT IMAGE PLANES&lt;br /&gt;
&lt;br /&gt;
 Due to DRI's vague documentation, no clear method has been&lt;br /&gt;
established as to how to store the color bit image data and seems&lt;br /&gt;
to be totally open to each authors interpretation.&lt;br /&gt;
&lt;br /&gt;
 Some have chosen to store each plane of data in its entirety and&lt;br /&gt;
separate from another, while other authors decided to interleave&lt;br /&gt;
rasters of each plane.&lt;br /&gt;
 Once again, each method has advantages and disadvantages. Somehow,&lt;br /&gt;
it would not be suprising to soon find yet a third method appear&lt;br /&gt;
that stores each pixel in its entirety (like GIF files) or even a&lt;br /&gt;
fourth method that stores the plane data in a direct ST video&lt;br /&gt;
layout (like DEGAS, TINY, NEO).&lt;br /&gt;
&lt;br /&gt;
            Conclusion:  incompatible bit-image&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
 If it is true, then, that there exists only one IMG format then&lt;br /&gt;
it must also be true that the IMG format is, indeed, incompatible&lt;br /&gt;
with itself.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
-------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
 Here, then, are four of the color IMG dialects currently in use.&lt;br /&gt;
&lt;br /&gt;
 We'll label them:     NOSIG,  HYPERPAINT,  XIMG  and  STTT.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
 NOSIG is an archaic dialect that is limited to 16 colors. We call&lt;br /&gt;
it NOSIG because it contains no signature or no means by which to&lt;br /&gt;
determine exactly what dialect this file may be.&lt;br /&gt;
 We say it is fixed to only 16 colors because, 1) no 256 color IMGs&lt;br /&gt;
of this sort have been seen and, 2) one must _assume_ that any &lt;br /&gt;
8-plane form would follow the same procedures as a four plane file.&lt;br /&gt;
&lt;br /&gt;
SIGNATURE: none&lt;br /&gt;
PALETTE  : XBIOS (fixed at 16 colors)&lt;br /&gt;
BITIMAGE : separate planes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 HYPERPAINT is an IMG format with a twist. A noted graphic editor&lt;br /&gt;
will also create these files when used on an STe (using the STe's&lt;br /&gt;
higher color capacity).&lt;br /&gt;
SIGNATURE: word $0080 preceeds palette&lt;br /&gt;
PALETTE  : XBIOS&lt;br /&gt;
BITIMAGE : interleaved raster planes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 XIMG is called such since it stores that ascii text, &amp;quot;XIMG&amp;quot;, as&lt;br /&gt;
a signature in the file header.&lt;br /&gt;
note: XIMG states an img version of 2&lt;br /&gt;
SIGNATURE: long &amp;quot;XIMG&amp;quot; preceeds palette&lt;br /&gt;
PALETTE  : VDI style&lt;br /&gt;
BITIMAGE : separate planes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 STTT is called such since it stores that ascii text, &amp;quot;STTT&amp;quot;, as&lt;br /&gt;
a signature in the file header.&lt;br /&gt;
SIGNATURE: long &amp;quot;STTT&amp;quot; preceeds palette&lt;br /&gt;
PALETTE  : XBIOS&lt;br /&gt;
BITIMAGE : separate planes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                 Legend for following chart:&lt;br /&gt;
                          A) NOSIG&lt;br /&gt;
                          B) HYPERPAINT&lt;br /&gt;
                          C) XIMG&lt;br /&gt;
                          D) STTT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 Sample/Typical IMG file headers for 4 plane/ 16 color IMG file:&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
offset  description      A         B         C         D&lt;br /&gt;
-----------------------------------------------------------------&lt;br /&gt;
  0     imgver           1         1         2         1&lt;br /&gt;
  2     hedlen          24        25        59        27&lt;br /&gt;
  4     planes           4         4         4         4&lt;br /&gt;
  6     patdef           2         2         1         1&lt;br /&gt;
  8     micwid       $0294     $022C     $022C     $0116&lt;br /&gt;
 10     michgt       $02DF     $022C     $022C     $0116&lt;br /&gt;
 12     imgwid           _         _         _         _&lt;br /&gt;
 14     imghgt           _         _         _         _&lt;br /&gt;
 - - - - - -                 &lt;br /&gt;
 16                    pal     $0080      &amp;quot;XI&amp;quot;      &amp;quot;ST&amp;quot;&lt;br /&gt;
 18                              pal      &amp;quot;MG&amp;quot;      &amp;quot;TT&amp;quot;&lt;br /&gt;
 20                                     $0000      $0010&lt;br /&gt;
 22                                       pal        pal&lt;br /&gt;
 24          &lt;br /&gt;
-----------------------------------------------------------------&lt;br /&gt;
 notes:&lt;br /&gt;
 &lt;br /&gt;
    the image width and height are not shown as these will be&lt;br /&gt;
    totally dependent upon the particular image in the file.&lt;br /&gt;
    'pal' denotes where the palette begins in the header.&lt;br /&gt;
&lt;br /&gt;
    a 256 color IMG header is very similar.  PLANES will be 8 &lt;br /&gt;
    and the value in 'hedlen' will be larger to encompass the&lt;br /&gt;
    larger color palette.&lt;br /&gt;
&lt;br /&gt;
    The value in the header's headlength will always contain at&lt;br /&gt;
    least an eight since the IMG must have at least the 8 normal&lt;br /&gt;
    header words. Additional words will be added to this sum for&lt;br /&gt;
    the palette and any signature word or long.&lt;br /&gt;
&lt;br /&gt;
    VDI   palette: 3 words per color (1 for each of R,G,B)&lt;br /&gt;
    XBIOS palette: 1 word per color. &lt;br /&gt;
 &lt;br /&gt;
    For a  16 color VDI palette  :  48 words&lt;br /&gt;
    For a  16 color XBIOS palette:  16 words&lt;br /&gt;
    For a 256 color VDI palette  : 768 words&lt;br /&gt;
    For a 256 color XBIOS palette: 256 words&lt;br /&gt;
 &lt;br /&gt;
    Different variations of color IMGs may also include a signature&lt;br /&gt;
    which is also counted in the HEADER LENGTH word.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
                             NOSIG&lt;br /&gt;
&lt;br /&gt;
off descrp     A&lt;br /&gt;
---------------------------------------------------------------&lt;br /&gt;
 0  imgver     1  always 1, as per DRI specs&lt;br /&gt;
 2  hedlen    24  24 words = 8 normal + 16 color&lt;br /&gt;
 4  planes     4  four planes&lt;br /&gt;
 6  patdef     2  &lt;br /&gt;
 8  micwid $0294   38 DPI&lt;br /&gt;
10  michgt $02DF   34 DPI&lt;br /&gt;
12  imgwid     _&lt;br /&gt;
14  imghgt     _&lt;br /&gt;
- - - - - -  &lt;br /&gt;
16           the palette begins here and is 16 words in the&lt;br /&gt;
             XBIOS format (1 word per palette entry)&lt;br /&gt;
             immediatly following the palette is the bitimage&lt;br /&gt;
             with each plane stored in its entirety.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
notes:    none&lt;br /&gt;
             &lt;br /&gt;
problems: Since no signature exists, one must _assume_ that any&lt;br /&gt;
          4-plane IMG file is actually this format.&lt;br /&gt;
&lt;br /&gt;
possible:&lt;br /&gt;
solution: Check for all other variants first. If the other&lt;br /&gt;
          tests fail then assume that the IMG is this type.&lt;br /&gt;
===============================================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
                           HYPERPAINT&lt;br /&gt;
&lt;br /&gt;
off descrp     B&lt;br /&gt;
---------------------------------------------------------------&lt;br /&gt;
 0  imgver     1  always 1, as per DRI specs&lt;br /&gt;
 2  hedlen    25  8 normal + 16 colors + 1 signature&lt;br /&gt;
 4  planes     4  four planes&lt;br /&gt;
 6  patdef     2  &lt;br /&gt;
 8  micwid $022C   45 DPI&lt;br /&gt;
10  michgt $022C   45 DPI&lt;br /&gt;
12  imgwid     _&lt;br /&gt;
14  imghgt     _&lt;br /&gt;
- - - - - -  &lt;br /&gt;
16         $0080 (128) this is the only signature of this&lt;br /&gt;
             dialect.&lt;br /&gt;
18         the palette begins here and is 16 words in the&lt;br /&gt;
           XBIOS format (1 word per palette entry)&lt;br /&gt;
           immediatly following the palette is the bitimage&lt;br /&gt;
           stored as 4 rasters (one from each plane) inter-&lt;br /&gt;
           leaved.&lt;br /&gt;
&lt;br /&gt;
notes:     The order of the rasters are inverted! Plane-0 is&lt;br /&gt;
           the last raster in each group. In a four-plane IMG,&lt;br /&gt;
           the order of the rasters is: planes 3,2,1,0&lt;br /&gt;
             &lt;br /&gt;
problems:  The simple signature is misleading since the NOSIG&lt;br /&gt;
           variant expects the palette to begin here, may easily&lt;br /&gt;
           mistake the $0080 signature word to be the first&lt;br /&gt;
           color of the palette.&lt;br /&gt;
           Since these two dialects, NOSIG and HYPERPAINT, are&lt;br /&gt;
           very different in plane layout, you'll find that a&lt;br /&gt;
           wrong choice of dialect will result in a totally&lt;br /&gt;
           garbaged picture.&lt;br /&gt;
         &lt;br /&gt;
&lt;br /&gt;
possible:&lt;br /&gt;
solution:  The possibility of $0080 being the first palette&lt;br /&gt;
           entry is slim (but still probable). &amp;quot;Best Guess&amp;quot;&lt;br /&gt;
           is all that can be said here.&lt;br /&gt;
           &lt;br /&gt;
         &lt;br /&gt;
===============================================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                             XIMG&lt;br /&gt;
&lt;br /&gt;
off descrp     C&lt;br /&gt;
---------------------------------------------------------------&lt;br /&gt;
 0  imgver     2  NOTE THIS!! &lt;br /&gt;
 2  hedlen    59  8 normal + (16 colors *3) + 3 signature&lt;br /&gt;
 4  planes     4  four planes&lt;br /&gt;
 6  patdef     1&lt;br /&gt;
 8  micwid $022C   45 DPI&lt;br /&gt;
10  michgt $022C   45 DPI&lt;br /&gt;
12  imgwid     _&lt;br /&gt;
14  imghgt     _&lt;br /&gt;
- - - - - -  &lt;br /&gt;
16         &amp;quot;XIMG&amp;quot; signature (4 bytes)&lt;br /&gt;
20         $0000  zero word &lt;br /&gt;
22         the palette begins here. It holds 3 words per color&lt;br /&gt;
           in the VDI format of 0-1000.&lt;br /&gt;
           ( 16 colors =  48 words)&lt;br /&gt;
           (256 colors = 768 words)&lt;br /&gt;
           immediatly following the palette is the bitimage&lt;br /&gt;
           stored as separate planes.&lt;br /&gt;
&lt;br /&gt;
notes:     none&lt;br /&gt;
           &lt;br /&gt;
           &lt;br /&gt;
             &lt;br /&gt;
problems:  Eight plane images may appear a bit unwieldy but&lt;br /&gt;
           innovative coding can easily clear this hurdle.&lt;br /&gt;
&lt;br /&gt;
possible:  Keep a pointer to the image buffer start and&lt;br /&gt;
solution:  weave the image into the proper planes as you&lt;br /&gt;
           uncompress it.&lt;br /&gt;
&lt;br /&gt;
===============================================================&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
                             STTT&lt;br /&gt;
&lt;br /&gt;
off descrp     D&lt;br /&gt;
---------------------------------------------------------------&lt;br /&gt;
 0  imgver     1  as per DRI specs&lt;br /&gt;
 2  hedlen    27  8 normal + 16 colors + 3 signature&lt;br /&gt;
 4  planes     4  four planes&lt;br /&gt;
 6  patdef     1&lt;br /&gt;
 8  micwid $0116   90 DPI&lt;br /&gt;
10  michgt $0116   90 DPI&lt;br /&gt;
12  imgwid     _&lt;br /&gt;
14  imghgt     _&lt;br /&gt;
- - - - - -  &lt;br /&gt;
16         &amp;quot;STTT&amp;quot; signature (4 bytes)&lt;br /&gt;
20         $0010  palette count (or the number of colors)&lt;br /&gt;
22         the palette begins here and is in XBIOS form&lt;br /&gt;
           (1 word per palette entry)&lt;br /&gt;
           ( 16 colors =  16 words)&lt;br /&gt;
           (256 colors = 256 words)&lt;br /&gt;
           immediatly following the palette is the bitimage&lt;br /&gt;
           stored as separate planes.&lt;br /&gt;
&lt;br /&gt;
notes:     the 'palette count' word is a good redundancy check&lt;br /&gt;
           &lt;br /&gt;
           &lt;br /&gt;
             &lt;br /&gt;
problems:  Eight plane images may appear a bit unwieldy but&lt;br /&gt;
           innovative coding can easily clear this hurdle.&lt;br /&gt;
&lt;br /&gt;
possible:  Keep a pointer to the image buffer start and&lt;br /&gt;
solution:  weave the image into the proper planes as you&lt;br /&gt;
           uncompress it.&lt;br /&gt;
&lt;br /&gt;
===============================================================&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Back to [[Pictures_Files]]&lt;/div&gt;</summary>
		<author><name>&gt;Zorro 2</name></author>
	</entry>
</feed>