<?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=QuantumPaint_file_format</id>
	<title>QuantumPaint file format - 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=QuantumPaint_file_format"/>
	<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=QuantumPaint_file_format&amp;action=history"/>
	<updated>2026-07-27T11:13:16Z</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=QuantumPaint_file_format&amp;diff=16585&amp;oldid=prev</id>
		<title>&gt;Lp: New page</title>
		<link rel="alternate" type="text/html" href="https://www.temlib.org/AtariForumWiki/index.php?title=QuantumPaint_file_format&amp;diff=16585&amp;oldid=prev"/>
		<updated>2017-01-03T00:07:11Z</updated>

		<summary type="html">&lt;p&gt;New page&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;
QuantumPaint    *.PBX (low and medium resolution)&lt;br /&gt;
&lt;br /&gt;
3 bytes         0&lt;br /&gt;
1 byte          mode, 0x00 =  128 color low resolution pciture, &lt;br /&gt;
                      0x01 =   32 color medium resolution picture,&lt;br /&gt;
                      0x80 =  512 color picture low resolution picture&lt;br /&gt;
                      0x81 = 4096 color picture low resolution picture&lt;br /&gt;
1 word          0x8001 = compressed&lt;br /&gt;
                Quantumpaint v2.00 sets it to 0x8000 for uncompressed files&lt;br /&gt;
                Quantumpaint v1.00 seems to use 0x0000 for lowras and 0x0333&lt;br /&gt;
                for medium res bytes. The PBX viewer only tests for 0x8001.&lt;br /&gt;
122 bytes       ??&lt;br /&gt;
                total 128 header bytes&lt;br /&gt;
?? bytes        palette data;&lt;br /&gt;
                for uncompressed normal pictures 8 pallete datasets follow:&lt;br /&gt;
                    16 words: 16 palettes&lt;br /&gt;
                     1 word: number of the first line this pallet is used&lt;br /&gt;
                     1 word: 0 the palette is not active, else this pallete is active&lt;br /&gt;
                     1 word: first color of color cycle&lt;br /&gt;
                     1 word: last color of color cycle&lt;br /&gt;
                     1 word: cycle speed, number of vbl's between steps, 0 = fastest&lt;br /&gt;
                     1 word: 0: no cycling, 1 cycle right, 0xffff cycle left&lt;br /&gt;
                     2 word: ?? should be zero&lt;br /&gt;
                    __&lt;br /&gt;
                    48 bytes per palette&lt;br /&gt;
                    The first palette should always be active and start on line 0&lt;br /&gt;
                   ___&lt;br /&gt;
                   384 bytes palette data for low (128 color) and medium (32 color) pictures&lt;br /&gt;
                for uncompressed 512 color pictures 6400 words (32 colors per scanline)&lt;br /&gt;
                for uncompressed 4096 color pictures 12800 words (32 colors per scanline,&lt;br /&gt;
                2 palette sets for alternating screens, two 6400 word blocks)&lt;br /&gt;
?? bytes        screen data, for uncompressed pictures this is 32000 bytes for all modes&lt;br /&gt;
--------&lt;br /&gt;
&amp;gt; 128 bytes total&lt;br /&gt;
&lt;br /&gt;
Compression scheme&lt;br /&gt;
Palette and screen data are compressed into one block using packbits compression.&lt;br /&gt;
The expanded screen data is not simply screen memory bitmap data; instead, the &lt;br /&gt;
data is divided into four sets of vertical columns.  (This results in&lt;br /&gt;
better compression.)  A column consists of one specific word taken&lt;br /&gt;
from each scan line, going from top to bottom.  For example, column 1 &lt;br /&gt;
consists of word 1 on scanline 1 followed by word 1 on scanline 2, etc., &lt;br /&gt;
followed by word 1 on scanline 200.&lt;br /&gt;
   The columns appear in the following order:&lt;br /&gt;
&lt;br /&gt;
   1st set contains columns 1, 5,  9, 13, ..., 69, 73, 77 in order&lt;br /&gt;
   2nd set contains columns 2, 6, 10, 14, ..., 70, 74, 78 in order&lt;br /&gt;
   3rd set contains columns 3, 7, 11, 15, ..., 71, 75, 79 in order&lt;br /&gt;
   4th set contains columns 4, 8, 12, 16, ..., 72, 76, 80 in order&lt;br /&gt;
This colmn ordering is just the same as in the Tiny format.&lt;br /&gt;
for medium res it is the same only with two stes for the two medium res bitplanes.&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
 *  Given an x-coordinate and a color index, returns the corresponding&lt;br /&gt;
 *  QuantumPaint palette index.&lt;br /&gt;
 *&lt;br /&gt;
 *  by Hans Wessels; placed in the public domain January, 2008.&lt;br /&gt;
 */&lt;br /&gt;
int find_pbx_index(int x, int c)&lt;br /&gt;
{&lt;br /&gt;
	int x1 = 10 * c;&lt;br /&gt;
	if (1 &amp;amp; c)&lt;br /&gt;
	{	/* If c is odd */&lt;br /&gt;
		x1 = x1 - 5;&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{	/* If c is even */&lt;br /&gt;
		x1 = x1 + 1;&lt;br /&gt;
	}&lt;br /&gt;
	if(c&amp;gt;7)&lt;br /&gt;
	{&lt;br /&gt;
	  x1+=12;&lt;br /&gt;
	}&lt;br /&gt;
	if(x&amp;gt;=(x1+75))&lt;br /&gt;
	{&lt;br /&gt;
		c = c + 16;&lt;br /&gt;
	}&lt;br /&gt;
	return c;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Back to [[ST Picture Formats]]&lt;/div&gt;</summary>
		<author><name>&gt;Lp</name></author>
	</entry>
</feed>