This file is created in response to rather poor documentation [1] for PXD file format consumed by Autodesk Pixlr and other peoducts (e.g., Autodesk SketchBook Pro).
The PXD file, as noted by the few lines in the docs, consists of a header, followed by an array of layers, and then with composite pixel data (on versions >= 3?). All integers within the file are big-endian. The whole file is compressed with zlib.
- Format version (16 bits), the latest one seems to be 3.
- Color mode (16 bits), unknown domain.
- Image width (32 bits).
- Image height (32 bits).
- Number of layers (16 bits).
- Composite image offset (32 bits). Present only if the version >= 3.
- Length of the layer data, bytes (32 bits). Excludes the length value itself.
- Layer name (Pascal-type string with 16-bit length prepended).
- Unknown value (8 bits).
- Layer position (X) (32 bits).
- Layer position (Y) (32 bits).
- Layer width (32 bits).
- Layer height (32 bits).
- Opacity (8 bits). Domain: 0..100.
- Visibility (8 bits, boolean).
- Layer mode (8 bits). Known values: 0 = Normal, 1 = Add, 10 = Multiply, 11 = ???, 12 = Screen.
- Unknown value (8 bits, boolean). Present only if the version > 1.
- Length of bitmap data, bytes (32 bits). If > 0, bitmap data for this layer follows directly after this member.
- Unknown value (32 bits).
- Unknown value (8 bits). Appears to be a count. If > 0, some additional processing occurs.
- Unknown value (16 bits). Appears to be a count. If > 0, some additional processing occurs.
Thanks a lot for this! I added the support for PXD files into www.Photopea.com :) It can also parse layer masks, text layers and layer styles (drop shadow, emboss ...).