-
Notifications
You must be signed in to change notification settings - Fork 0
CZ Image Formats
The CZ# image formats are used by LUCA System to store image data. this includes character sprites, background CGs, fonts, and UI elements. All of the CZ# formats utilize lossless compression so the quality of images is very high.
CZ0 is an uncompressed format which stores the image data as a raw bitmap of pixels. It is often used for character sprites and some UI elements.
CZ1 is a compressed format usually used to store font bitmaps. The basis of many of the other formats compression is based on the compression in CZ1. Most font files encountered will be palette mapped 8 BPP.
The compression is an implementation of LZW compression, so it's relatively simple and provides a good degree of compression.
CZ2 is a compressed format used to store fonts.
CZ3 is a compressed format used to store mainly CGs. The compression is slightly worse than PNG.
CZ4 is a compressed format used to store CGs, character sprites, and UI elements. Its compression is on-par with or even better than PNG.
Each CZ#
file starts with a variable length header, followed by an optional
color palette for indexed images when the header bit depth is less than 8
bits per pixel (BPP). This is then
followed by information about the compressed data (in formats which are compressed),
followed by the actual image data. There is no footer or any pattern of stop bytes.
All byte layouts are in Little Endian.
The first 15 (0x0F
) bytes of the header
are common to all CZ#
files. The data which come after that are specific
to each format, although several CZ#
formats do share the same general
layout.
Offset | Ex. Values | ASCII | Purpose |
---|---|---|---|
0x00 - 0x03 | 43 5A 30 00 | CZ0 | Magic bytes |
0x04 - 0x07 | 24 00 00 00 | 36 | Header length in bytes |
0x08 - 0x09 | 58 01 | 344 | Width of the image in pixels |
0x0A - 0x0B | DC 02 | 732 | Height of the image in pixels |
0x0C - 0x0D | 20 00 | 32 | Bit depth of the image |
0x0E | 03 | 3 | Unknown, but usually is 3 |
Offset | Ex. Values | ASCII | Purpose |
---|---|---|---|
0x0F - 0x13 | --- | --- | ---[Unknown]--- |
0x14 - 0x15 | 58 01 | 344 | Width of image crop |
0x16 - 0x17 | DC 02 | 732 | Height of image crop |
0x18 - 0x19 | 00 05 | 1280 | Width of image bounding box |
0x1A - 0x1B | 34 03 | 820 | Height of image bounding box |
0x1C - 0x1D | 80 02 | 640 | X offset of image, optional |
0x1E - 0x1F | 02 03 | 770 | Y offset of image, optional |
0x20 - 0x23 | --- | --- | ---[Unknown]---, optional |
Offset | Ex. Values | ASCII | Purpose |
---|---|---|---|
0x0F - 0x12 | --- | --- | ---[Unknown]--- |