

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.amigaos.net/w/index.php?action=history&amp;feed=atom&amp;title=DEEP_IFF_Chunky_Pixel_Image</id>
	<title>DEEP IFF Chunky Pixel Image - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.amigaos.net/w/index.php?action=history&amp;feed=atom&amp;title=DEEP_IFF_Chunky_Pixel_Image"/>
	<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=DEEP_IFF_Chunky_Pixel_Image&amp;action=history"/>
	<updated>2026-05-16T08:37:04Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.amigaos.net/w/index.php?title=DEEP_IFF_Chunky_Pixel_Image&amp;diff=2123&amp;oldid=prev</id>
		<title>Steven Solie: Created page with &quot;= DEEP =  &lt;pre&gt; Chunky pixel image files (Used in TV Paint)  IFF FORM / CHUNK DESCRIPTION ============================  Form/Chunk ID:	FORM  DEEP	(DEEP pixels) 		Chunk DGBL	(D...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.amigaos.net/w/index.php?title=DEEP_IFF_Chunky_Pixel_Image&amp;diff=2123&amp;oldid=prev"/>
		<updated>2012-05-10T19:55:04Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= DEEP =  &amp;lt;pre&amp;gt; Chunky pixel image files (Used in TV Paint)  IFF FORM / CHUNK DESCRIPTION ============================  Form/Chunk ID:	FORM  DEEP	(DEEP pixels) 		Chunk DGBL	(D...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= DEEP =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Chunky pixel image files (Used in TV Paint)&lt;br /&gt;
&lt;br /&gt;
IFF FORM / CHUNK DESCRIPTION&lt;br /&gt;
============================&lt;br /&gt;
&lt;br /&gt;
Form/Chunk ID:	FORM  DEEP	(DEEP pixels)&lt;br /&gt;
		Chunk DGBL	(Deep GloBaL information)&lt;br /&gt;
		Chunk DPEL	(Deep Pixel ELements)&lt;br /&gt;
		Chunk DLOC	(Deep display LOCation)&lt;br /&gt;
		Chunk DBOD	(Deep data BODy)&lt;br /&gt;
		Chunk DCHG	(Deep CHanGe buffer)&lt;br /&gt;
&lt;br /&gt;
Date Submitted:	10-Sep-91&lt;br /&gt;
Submitted by:	Amiga Centre Scotland&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FORM&lt;br /&gt;
====&lt;br /&gt;
&lt;br /&gt;
FORM ID:	DEEP	(DEEP pixels)&lt;br /&gt;
&lt;br /&gt;
FORM Purpose:&lt;br /&gt;
&lt;br /&gt;
To allow faster loading and saving of images when pixels are&lt;br /&gt;
stored in consecutive memory locations and provide support for&lt;br /&gt;
common extensions implemented on advanced graphics cards.&lt;br /&gt;
&lt;br /&gt;
FORM Description:&lt;br /&gt;
&lt;br /&gt;
This form is designed to provide support for a variety of deep&lt;br /&gt;
pixels, including 24 bits images.  A deep pixel is one in which&lt;br /&gt;
the pixel value is used to directly produce the output colour&lt;br /&gt;
without the use of a colour look-up table and also where the&lt;br /&gt;
pixel is stored in consecutive memory locations.  The format&lt;br /&gt;
allows additional bits to be stored along with the colour bits&lt;br /&gt;
to provide support for additional features such as masks,&lt;br /&gt;
Z-buffers, linear keys, etc.&lt;br /&gt;
&lt;br /&gt;
The format is designed to allow different colour formats to be&lt;br /&gt;
stored such as RGB, RGBA, YCM and YCMB with varying depths&lt;br /&gt;
supported.  Bit ordering will be most significant bit first.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
CHUNKS&lt;br /&gt;
======&lt;br /&gt;
&lt;br /&gt;
Chunk ID:	DGBL	(Deep GloBaL information)&lt;br /&gt;
&lt;br /&gt;
Chunk Purpose:&lt;br /&gt;
&lt;br /&gt;
Provide global information of relevance to all the data contained&lt;br /&gt;
in the file.  DGBL will always be the first chunk in the file.&lt;br /&gt;
&lt;br /&gt;
Chunk Description:&lt;br /&gt;
&lt;br /&gt;
Used to provide information that is constant for all contents of&lt;br /&gt;
the file.  One chunk is mandatory at the start of the file.  When&lt;br /&gt;
the file is used to store a group of images it may, in&lt;br /&gt;
exceptional circumstances, be necessary to add additional DGBL&lt;br /&gt;
chunks.  The contents of a DGBL chunk remain valid until another&lt;br /&gt;
DGBL chunk is encountered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Chunk ID:	DPEL	(Deep Pixel Elements)&lt;br /&gt;
&lt;br /&gt;
Chunk Purpose:&lt;br /&gt;
&lt;br /&gt;
Defines the contents of each pixel.  Enables the data content to&lt;br /&gt;
be identified and handled.  Data that is unknown or not required&lt;br /&gt;
can be discarded.&lt;br /&gt;
&lt;br /&gt;
Chunk Description:&lt;br /&gt;
&lt;br /&gt;
This chunk is best described by an example:&lt;br /&gt;
&lt;br /&gt;
	Original data = RGBA 8:8:8:4&lt;br /&gt;
&lt;br /&gt;
	DPEL =&lt;br /&gt;
		4	(number of elements)&lt;br /&gt;
			RED	(first element)&lt;br /&gt;
			8	(bits in element)&lt;br /&gt;
			GREEN	(second element)&lt;br /&gt;
			8	(bits in second element)&lt;br /&gt;
			BLUE	(third element)&lt;br /&gt;
			8	(bits in third element)&lt;br /&gt;
			ALPHA	(fourth element)&lt;br /&gt;
			4	(bits in fourth element)&lt;br /&gt;
&lt;br /&gt;
	Stored data (binary) = rrrrrrrr gggggggg bbbbbbbb aaaa0000&lt;br /&gt;
&lt;br /&gt;
  Note:  The pixel has been padded to the next byte boundary.&lt;br /&gt;
&lt;br /&gt;
The elements must be defined in the order in which they are&lt;br /&gt;
stored, with the most significant bit first.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Chunk ID:	DLOC	(Deep display LOCation)&lt;br /&gt;
&lt;br /&gt;
Chunk Purpose:&lt;br /&gt;
&lt;br /&gt;
Provides information specific to the following DBOD section.&lt;br /&gt;
Enables image sections to be located within the screen area&lt;br /&gt;
individually &amp;amp; allows images with a size different to&lt;br /&gt;
DisplayWidth &amp;amp; DisplayHeight to be stored.&lt;br /&gt;
&lt;br /&gt;
Chunk Description:&lt;br /&gt;
&lt;br /&gt;
Specifies the width, height and where to place the following Deep&lt;br /&gt;
data BODy.  If no DLOC is encountered before a DBOD, the&lt;br /&gt;
DisplayWidth &amp;amp; DisplayHeight parameters will be used as the DBOD&lt;br /&gt;
image data dimensions.  The contents of a DLOC chunk remain valid&lt;br /&gt;
until another DLOC chunk is encountered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Chunk ID:	DBOD	(Deep BODy)&lt;br /&gt;
&lt;br /&gt;
Chunk Purpose:&lt;br /&gt;
&lt;br /&gt;
Contains the image data.&lt;br /&gt;
&lt;br /&gt;
Chunk Description:&lt;br /&gt;
&lt;br /&gt;
Contains image data compressed by the method defined in DGBL.&lt;br /&gt;
The image size and the location where it is to be displayed is&lt;br /&gt;
provided by a DLOC chunk.  If no DLOC chunk has been read the&lt;br /&gt;
data will be displayed in the upper left corner and will be&lt;br /&gt;
DisplayWidth wide and DisplayHeight high.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Chunk ID:	DCHG	(Deep CHanGe buffer)&lt;br /&gt;
&lt;br /&gt;
Chunk Purpose:&lt;br /&gt;
&lt;br /&gt;
Informs the IFF reader that a complete frame has been read.  Only&lt;br /&gt;
required when multiple images are stored for cell animation.&lt;br /&gt;
&lt;br /&gt;
Chunk Description:&lt;br /&gt;
&lt;br /&gt;
When a DCHG chunk is encounter the IFF reader knows that a&lt;br /&gt;
complete frame has been read.  The chunk gives the time *from the&lt;br /&gt;
last frame change* before the frame should be changed again.  If&lt;br /&gt;
the time has already elapsed the frame should be changed&lt;br /&gt;
immediately.  A FrameRate of 0 will cause the frame changes to&lt;br /&gt;
occur as fast as possible.  A FrameRate of -1 is used to indicate&lt;br /&gt;
the end of the data for one frame and the start of the next in&lt;br /&gt;
cases where multiple frames are stored but are not intended for&lt;br /&gt;
animation.  A DCHG chunk is not required when only a single frame&lt;br /&gt;
is stored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
//&lt;br /&gt;
//FORM DEEP&lt;br /&gt;
//=========&lt;br /&gt;
//&lt;br /&gt;
//  Chunk DGBL&lt;br /&gt;
//  ----------&lt;br /&gt;
//&lt;br /&gt;
    struct DGBL = {&lt;br /&gt;
//&lt;br /&gt;
// Size of source display&lt;br /&gt;
//&lt;br /&gt;
      UWORD  DisplayWidth,DisplayHeight;&lt;br /&gt;
//&lt;br /&gt;
// Type of compression&lt;br /&gt;
//&lt;br /&gt;
      UWORD  Compression;&lt;br /&gt;
//&lt;br /&gt;
// Pixel aspect, a ration w:h&lt;br /&gt;
//&lt;br /&gt;
      UBYTE  xAspect,yAspect;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
//&lt;br /&gt;
//   Chunk DPEL&lt;br /&gt;
//   ----------&lt;br /&gt;
    struct DPEL = {&lt;br /&gt;
//&lt;br /&gt;
// Number of pixel components&lt;br /&gt;
//&lt;br /&gt;
    ULONG nElements;&lt;br /&gt;
//&lt;br /&gt;
// The TypeDepth structure is repeated nElement times to identify&lt;br /&gt;
// the content of every pixel.  Pixels will always be padded to&lt;br /&gt;
// byte boundaries.  The DBOD chunk will be padded to an even&lt;br /&gt;
// longword boundary.&lt;br /&gt;
//&lt;br /&gt;
    struct TypeDepth = {&lt;br /&gt;
//&lt;br /&gt;
// Type of data&lt;br /&gt;
//&lt;br /&gt;
      UWORD cType;&lt;br /&gt;
//&lt;br /&gt;
// Bit depth of this type&lt;br /&gt;
//&lt;br /&gt;
      UWORD cBitDepth;&lt;br /&gt;
      } typedepth[Nelements];&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
//&lt;br /&gt;
//  Chunk DLOC&lt;br /&gt;
//  ----------&lt;br /&gt;
//&lt;br /&gt;
    struct DLOC = {&lt;br /&gt;
//&lt;br /&gt;
// Body width &amp;amp; height in pixels&lt;br /&gt;
//&lt;br /&gt;
      UWORD	w,h&lt;br /&gt;
//&lt;br /&gt;
// Pixel position for this image&lt;br /&gt;
//&lt;br /&gt;
      WORD	x,y&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
//&lt;br /&gt;
//  Chunk DBOD&lt;br /&gt;
//  ----------&lt;br /&gt;
//&lt;br /&gt;
    pixel[0], pixel[2], pixel[3], ...., pixel[w-1]&lt;br /&gt;
    pixel[((h-1)*w)], ...,pixel[h*w-1]&lt;br /&gt;
&lt;br /&gt;
//&lt;br /&gt;
//  Chunk DCHG&lt;br /&gt;
//  ----------&lt;br /&gt;
//&lt;br /&gt;
    struct DCHG = {&lt;br /&gt;
//&lt;br /&gt;
// Animation control (When multiple images are stored)&lt;br /&gt;
// FrameRate - milli-seconds between frames changes&lt;br /&gt;
//&lt;br /&gt;
      LONG  FrameRate;&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
Compressions currently defined:&lt;br /&gt;
&lt;br /&gt;
NOCOMPRESSION	=	0&lt;br /&gt;
RUNLENGTH	=	1&lt;br /&gt;
HUFFMAN		=	2&lt;br /&gt;
DYNAMICHUFF	=	3&lt;br /&gt;
JPEG		=	4&lt;br /&gt;
&lt;br /&gt;
Ctype currently defined:&lt;br /&gt;
&lt;br /&gt;
RED		=	1&lt;br /&gt;
GREEN		=	2&lt;br /&gt;
BLUE		=	3&lt;br /&gt;
ALPHA		=	4	(no precise definition of use)&lt;br /&gt;
YELLOW		=	5&lt;br /&gt;
CYAN		=	6&lt;br /&gt;
MAGENTA		=	7&lt;br /&gt;
BLACK		=	8&lt;br /&gt;
MASK		=	9&lt;br /&gt;
ZBUFFER		=	10&lt;br /&gt;
OPACITY		=	11&lt;br /&gt;
LINEARKEY	=	12&lt;br /&gt;
BINARYKEY	=	13&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Addendum&lt;br /&gt;
========&lt;br /&gt;
&lt;br /&gt;
The following information is an extension to the DEEP format&lt;br /&gt;
proposed by TecSoft and used in their 24 bit paint application,&lt;br /&gt;
TVPaint.  The extension provides an additional compression method&lt;br /&gt;
and its associated chunk.&lt;br /&gt;
&lt;br /&gt;
Additional compression type:&lt;br /&gt;
&lt;br /&gt;
TVDC		=	5&lt;br /&gt;
&lt;br /&gt;
Chunk ID:	TVDC	(TVPaint Deep Compression)&lt;br /&gt;
&lt;br /&gt;
Chunk Purpose:&lt;br /&gt;
&lt;br /&gt;
Provides the table of values required to enable decompression of&lt;br /&gt;
the image data.&lt;br /&gt;
&lt;br /&gt;
Chunk Description:&lt;br /&gt;
&lt;br /&gt;
TVDC is a modified version of Delta compression, using a 16 word&lt;br /&gt;
lookup table of delta values and also incorporates Run Length&lt;br /&gt;
Limiting compression for short runs.&lt;br /&gt;
&lt;br /&gt;
Note that the compression is made line by line for each element&lt;br /&gt;
of the chunk DPEL.  For RGBA for example we have a Red line, a&lt;br /&gt;
Green line, and so on.&lt;br /&gt;
&lt;br /&gt;
CDepackTVDC(source,dest,table,size)&lt;br /&gt;
UBYTE	*source;&lt;br /&gt;
UBYTE	*dest;&lt;br /&gt;
WORD	*table;&lt;br /&gt;
int	size;&lt;br /&gt;
{&lt;br /&gt;
int	i;&lt;br /&gt;
int	d;&lt;br /&gt;
int	pos=0;&lt;br /&gt;
UBYTE	v=0;&lt;br /&gt;
&lt;br /&gt;
	for(i=0;i&amp;lt;size;i++)&lt;br /&gt;
	{&lt;br /&gt;
		d=source[pos&amp;gt;&amp;gt;1];&lt;br /&gt;
		if(pos++&amp;amp;1) d&amp;amp;=0xf;&lt;br /&gt;
		else d&amp;gt;&amp;gt;=4;&lt;br /&gt;
		v+=table[d];&lt;br /&gt;
		dest[i]=v;&lt;br /&gt;
		if(!table[d])&lt;br /&gt;
		{&lt;br /&gt;
			d=source[pos&amp;gt;&amp;gt;1];&lt;br /&gt;
			if(pos++&amp;amp;1) d&amp;amp;=0xf;&lt;br /&gt;
			else d&amp;gt;&amp;gt;=4;&lt;br /&gt;
			while(d--) dest[++i]=v;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
	return((pos+1)/2);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Steven Solie</name></author>
	</entry>
</feed>