Canvas file format
Jump to navigation
Jump to search
Canvas *.CNV, *.CPT, *.HBL, *.FUL
Canvas is a simple drawing program for the Atari ST. The simplest file
format it uses is .CNV. The format has no info on the resolution of
the image. The colors are stored in VDI order.
48 bytes palette, value 0-7 per byte, RGB in VDI order.
32000 bytes image data
The CPT format is a compressed format:
16 words palette
1 word resolution (0=low, 1=med, 2=high resolution)
??? words compressed data, uncompressed 32000 bytes
Packing algorithm: first all runlength data is transfered. Then the
gaps that haven't been filled with runlengthdata is filled with the
remaining data from file.
Runlength data:
1 word repeat count
1 word offset
n words run length data (n=4 low, 2 med, 1 high)
The n words run length data are repeated (repeat count +1) times from
offset bytes from the start of the file. When repeat count $FFFF signifies
the end of the run length data (the offset and run length data still folow
the $FFFF repeat count).
??? words data to fill the gaps that haven't been filled with run
length data.
-------------------------------------------------------------------------------
*.HBL files:
There's also a special HBL mode with extra colors (ST low and medium only).
Canvas saves the extra colors in a separate file with the same name, but with
an *.HBL file extension. Canvas can change the palette every 4 scan lines, thus
50 palettes can be displayed at once. STe palette is supported.
50 words palette numbers, 1 per palette [0 to 63 or -1]
-1 = no change at that scanline, scanline = word index * 4
150 words unknown [low = all 0's, medium = all -1's]
400 bytes unknown [all 0's]
48 bytes default palette when HBLs are off? (RGB in VDI order)
for each flag that is <> -1 {
48 bytes palette (RGB in VDI order)
}
Notes: The palettes are stored in reserve. Example: Image uses 4 palettes.
palette ? (palette when HBLs are off?) <-- offset 800
palette #4 (last palette)
palette #3
palette #2
palette #1 (first palette) <- end of file
The size of the file can be calculated using this method:
count = the number of palette flags that are set to -1
file_size = 800 + ((count + 1) * 48)
Some HBL files contain palette numbers that are clearly out of range. Canvas
manages 64 palettes and seems to dump these values to the HBL file. The palette
number should be ignored and the important value is -1. Canvas dumps all the
palettes in order, regardless of duplicates.
-------------------------------------------------------------------------------
Canvas v1.17 introduced a new file format referred to as FullPic Picture
Format. These use the file extension FUL. Manual states: This is simply the
Compact Picture Format, HBL file and Animate file all in one file.
? bytes HBL data, identical to HBL file contents
608 bytes SEQ data, always 608 bytes (skip)
? bytes CPT data, identical to CTP file contents
---------
? bytes
Back to ST Picture Formats