TruePaint/Prism Paint file format

From AtariForumWiki
Jump to navigation Jump to search
TruePaint       *.TPI
Prism Paint     *.PNT

  1 long        $504e5400 'PNT\0' TruePaint Magic
  1 word        $0100             ???? file version
  1 word        palette_size      Might be there in true color
  1 word        x_size
  1 word        y_size
  1 word        bits_per_pixel
  1 word        compression, $0000 uncompressed, $0001 packbits compressed
  1 long        picture_data_size = ((x_size+15)&0xffff0)*y_size*bits_per_pixel/8 
                (uncompressed)
108 bytes       $0
---------
128 bytes       total for header

3*palette_size     words   Palette data, RGB, values 0..1000. The colors are in VDI order
                          
picture_data_size  bytes   The line length is a multiple of 16 pixels for all bit depths
                           Interleaved bitplanes for bits_per_pixel<16
                           16 bit word per pixel for 16-bit pictures, RRRRrGGGGGgBBBBBb
                           24 bit is stored R, G, B in that order

The prism paint compressed format uses the Packbits compression algorithm. For every 
scanline the bitplanes are compressed separately. The falcon high-color resolution 
(16 bit) is compressed as if there were 16 bitplanes, which there are not.
The same rule applies to 24 bits per pixel.

Additional information:
The TruePaint manual describes the format as designed for high speed and only writes
uncompressed files. Prism Paint on the other hand offers compression every time a
file is saved with an alert box (yes/no).

See also PackBits Compression Algorithm

Back to ST Picture Formats