Paintworks

From Just Solve the File Format Problem
Revision as of 04:06, 28 December 2023 by Dexvertbot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
File Format
Name Paintworks
Ontology
Extension(s) .cl0 .sc0 .cl1 .sc1 .cl2 .sc2 .pg0 .pg1 .pg2
Released 1986

Paintworks is a graphics program for the Atari ST published by Activision in 1986.

CL0/SC0 files are 320x200 with 16 colors

CL1/SC1 files are 640x200 with 4 colors

CL2/SC2 files are 640x400 in mono

Contents

Identification

From the Atari Forum Wiki page (see #Links):

Paintworks    *.SC0 *.CL0 (st low resolution)
              *.SC1 *.CL1 (st medium resolution)
              *.SC2 *.CL2 (st high resolution)
              *.PG0 (st low resolution, double high)
              *.PG1 (st medium resolution, double high)
              *.PG2 (st high resolution, double high)

Early versions of Paintworks were called N-Vision. These are often mistaken as
NEOchrome files. One should not rely on the file extension to determine the contents.

1 word       file id [0x00]
                 recommend using 'secondary file id' for identification
1 word       resolution [0 = low, 1 = medium, 2 = high]
                 recommend using 'flags' to determine resolution
16 words     palette
12 bytes     file name, usually ["        .   "]
1 word       ?
1 word       ?
1 word       ?
9 bytes      secondary file id ["ANvisionA"]
1 byte       flags, bit field: cxrrtttt
                 c = compression flag [1 = compressed]
                 x = not used
                 r = resolution [0 = low, 1 = medium, 2 = high]
                 t = type [0 = page, 1 = screen, 2 = clipart, 4 = pattern]
                     page = double high, thus 320x400, 640x400, 640x800
                     screen = standard st resolutions
                     clipart = standard st resolutions
                     pattern = no documentation at this time
64 bytes     ?
---------
128 bytes    total for header

?            image data:                                      
Uncompressed images are simply screen dumps as one might expect.

Compressed images are a two step process, RLE decoding and re-ordering.
RLE decompression:

/* Written by Lonny Pursell - placed in to Public Domain 1/28/2017 */
void decode_rle(uint8 *data, uint8 *bmap, uint32 bms) {
    uint8   cmd, chr;
    uint16  i;
    uint32  src=0, dst=0, cnt=0;
    do {
        cmd = data[src++];
        if (cmd & 0x80) {                   /* literal? */
            cmd = cmd & 0x7f;
            memcpy(&bmap[dst], &data[src], (uint32)cmd);
            dst = dst + (uint32)cmd;
            src = src + (uint32)cmd;
        } else {                            /* repeat? */
            chr = data[src++];
            for (i=0; i<cmd; i++) {
                bmap[dst++] = chr;
            }
        }
        cnt = cnt + cmd;
    } while (cnt<bms);
}

The uncompressed data is arranged as follows:

ST low resolution:
    All of plane 0..., all of plane 1..., all of plane 2..., all of plane 3...
ST medium resolution
    All of plane 0..., all of plane 1...
ST high resolution: 
    No rendering required.

Software

Sample files

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox