Everything Photoshop added to layers after version 3 is stored in tagged blocks: adjustment layers, effects, type, groups, smart objects and more. They appear at the end of each layer record and, for the whole document, at the end of the layer and mask information section. A reader skips any key it does not know.
Block layout
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | char[4] | Signature | 8BIM or 8B64. |
| 4 | char[4] | Key | The key, from the tables below. |
| 4/8 | u32/u64 | Length | Length of the data, rounded up to an even number. 8 bytes in a PSB file for the keys LMsk, Lr16, Lr32, Layr, Mt16, Mt32, Mtrn, Alph, FMsk, lnk2, FEid, FXid and PxSD; 4 bytes otherwise. |
| Length | bytes | Data | Depends on the key. |
Many blocks hold an Action descriptor, usually after a 4-byte descriptor version of 16.
Adjustment and fill layers
| Key | Layer |
|---|---|
SoCo | Solid colour fill: descriptor version and descriptor. |
GdFl | Gradient fill: descriptor version and descriptor. |
PtFl | Pattern fill: descriptor version and descriptor. |
brit | Brightness and contrast. |
levl | Levels. |
curv | Curves. |
expA | Exposure. |
vibA | Vibrance. |
hue | Hue and saturation, Photoshop 4.0 form. |
hue2 | Hue and saturation, Photoshop 5.0 and later. |
blnc | Colour balance. |
blwh | Black and white. |
phfl | Photo filter. |
mixr | Channel mixer. |
clrL | Colour lookup. |
nvrt | Invert. No data. |
post | Posterise. |
thrs | Threshold. |
grdm | Gradient map, and gradient settings (Photoshop 6.0). Layout below. |
selc | Selective colour. |
The levels, curves, hue and saturation and selective colour blocks use the same binary layouts as Photoshop’s saved settings files (.alv, .acv, .ahu, .asv), which Adobe documents in the same specification.
Effects
| Key | Contents |
|---|---|
lrFX | Layer effects, Photoshop 5.0 binary form. Layout below. |
lfx2 | Object-based effects, Photoshop 6.0 and later: 4-byte effects version (0), 4-byte descriptor version (16), descriptor. |
FEid | Filter effects (smart filters). |
FXid | Filter effects, a second form. |
ffxi | Foreign effect ID. |
FMsk | Filter mask: 10-byte colour space and colour, 2-byte opacity. |
anFX | Animation effects. |
lrFX
A 2-byte version (0) and a 2-byte effect count (6 in Photoshop 5.0 and 6.0, 7 in 7.0),
then each effect as a 8BIM signature, a 4-byte effect key and its data.
A colour is 10 bytes: a 2-byte colour space ID and four 2-byte components. A blend
mode is 8 bytes: 8BIM and a key.
| Effect key | Effect | Fields in order (bytes) |
|---|---|---|
cmnS | Common state | size 4 (7), version 4 (0), visible 1 (always true), unused 2. |
dsdw | Drop shadow | size 4 (41 or 51), version 4 (0 in 5.0, 2 in 5.5), blur 4, intensity 4, angle 4, distance 4, colour 10, blend mode 8, enabled 1, use global angle 1, opacity 1, native colour 10. |
isdw | Inner shadow | As the drop shadow. |
oglw | Outer glow | size 4 (32 or 42), version 4, blur 4, intensity 4, colour 10, blend mode 8, enabled 1, opacity 1; version 2 adds native colour 10. |
iglw | Inner glow | size 4 (33 or 43), version 4, blur 4, intensity 4, colour 10, blend mode 8, enabled 1, opacity 1; version 2 adds invert 1 and native colour 10. |
bevl | Bevel | size 4 (58 or 78), version 4, angle 4, depth 4, blur 4, highlight blend mode 8, shadow blend mode 8, highlight colour 10, shadow colour 10, style 1, highlight opacity 1, shadow opacity 1, enabled 1, use global angle 1, direction 1 (up or down); version 2 adds real highlight colour 10 and real shadow colour 10. |
sofi | Solid fill (7.0) | size 4 (34), version 4 (2), blend key 4, colour 10, opacity 1, enabled 1, native colour 10. |
Type and vector data
| Key | Contents |
|---|---|
tySh | Type tool information, Photoshop 5.0 and 5.5. |
TySh | Type tool object, Photoshop 6.0 and later. Layout below. |
Txt2 | Text engine data (CS3): the raw text engine bytes. |
vmsk | Vector mask: 4-byte version (3), 4-byte flags (value 1 invert, 2 not linked, 4 disabled; the specification numbers these bits 1 to 3), then path records to the end. |
vsms | The same vector mask, written by CS6 and later together with vscg. |
vscg | Vector stroke content (CS6): 4-byte key, 4-byte descriptor version (16), descriptor. |
vstk | Vector stroke (CS6): 4-byte descriptor version (16), descriptor. |
vogk | Vector origination (CC): 4-byte version (1), 4-byte descriptor version (16), descriptor. |
pths | Unicode path names. |
TySh
| Size | Type | Name | Description |
|---|---|---|---|
| 2 | u16 | Version | 1. |
| 48 | f64[6] | Transform | xx, xy, yx, yy, tx, ty. |
| 2 | u16 | TextVersion | 50. |
| 4 | u32 | DescriptorVersion | 16. |
| varies | descriptor | TextData | The text, its style runs and the raw text engine data. |
| 2 | u16 | WarpVersion | 1. |
| 4 | u32 | DescriptorVersion | 16. |
| varies | descriptor | WarpData | Text warp settings. |
| 32 | f64[4] | Bounds | Left, top, right, bottom. |
Layer identity and settings
| Key | Contents |
|---|---|
luni | The layer name as a Unicode string. |
lyid | Layer ID: 4 bytes. |
lnsr | Layer name source: a 4-byte ID. |
lyvr | Layer version: 4 bytes, the minimum Photoshop version that can read the layer without loss, such as 70 for 7.0 and 80 for 8.0. At least 70. |
lspf | Protected settings: 4 bytes of flags; bit 0 transparency, bit 1 composite, bit 2 position. |
lclr | Sheet colour: 8 bytes; only the first colour value is used. |
fxrp | Reference point: two 8-byte doubles. |
shmd | Metadata settings: a 4-byte count, then items of a 8BIM signature, a 4-byte key, a copy-on-sheet-duplication byte, 3 padding bytes, a 4-byte length and the data (often a descriptor). |
Anno | Annotations. Layout below. |
sn2P | Aligned rendering: 4 bytes, non-zero for on. |
cinf | Compositor used (2020): descriptor version (16) and descriptor. |
CgEd | Content generator extra data. |
artb, artd, abdd | Artboard data: descriptor version (16) and descriptor. |
Groups, masks and blending
| Key | Contents |
|---|---|
lsct | Section divider, which marks a layer group. Layout below. |
clbl | Blend clipped elements: 1 byte boolean, 3 padding. |
infx | Blend interior elements: 1 byte boolean, 3 padding. |
knko | Knockout: 1 byte boolean, 3 padding. |
tsly | Transparency shapes layer: 1 byte (1 layer transparency shapes effects, 0 treated as fill opacity), 3 padding. |
lmgm | Layer mask as global mask: 1 byte (1 the mask is applied last, over the layer and its effects), 3 padding. |
vmgm | Vector mask as global mask: the same, for the vector mask. |
brst | Channel blending restrictions: a 4-byte channel number for each channel that is turned off. |
LMsk | User mask (document-level). |
Mtrn, Mt16, Mt32 | Saved transparency of the merged image, for 8-, 16- and 32-bit documents. No data of their own. |
Alph | Listed with an 8-byte PSB length; not otherwise described. |
lsct
Photoshop stores a group as a run of layers between two markers: a hidden “bounding
section divider” layer at the bottom of the group and the group layer itself at the
top, both carrying lsct.
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | Type | 0 any other kind of layer, 1 open folder, 2 closed folder, 3 bounding section divider (hidden in the user interface). |
| 4 | char[4] | Signature | Only if the length is at least 12: 8BIM. |
| 4 | char[4] | BlendMode | Only if the length is at least 12: the group’s blend mode key. |
| 4 | u32 | SubType | Only if the length is at least 16: 0 normal, 1 scene group (affects the animation timeline). |
Layer pixel data blocks
| Key | Contents |
|---|---|
Layr | Layer info, laid out as in layers and masks. |
Lr16 | Layer info of a 16-bit document. |
Lr32 | Layer info of a 32-bit document. |
PxSc | Pixel source information (CC). |
PxSD | Pixel source data for 3D or video layers (CC 2015). |
Patterns
Patt, Pat2 and Pat3 hold lists of patterns, each
starting with its own 4-byte length. shpa holds pattern data.
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | Length | Length of this pattern. |
| 4 | u32 | Version | 1. |
| 4 | u32 | Mode | Image mode, with the colour mode values of the file header. |
| 4 | s16[2] | Point | Vertical, then horizontal. |
| varies | Unicode string | Name | Pattern name. |
| varies | Pascal string | ID | Unique ID. |
| 768 | u8[256 × 3] | ColorTable | Only for indexed mode: 256 RGB colours. |
| varies | Data | Virtual memory array list, below. |
The virtual memory array list is a 4-byte version (3), a 4-byte length, a 16-byte rectangle and a 4-byte channel count. Then for each channel, plus a user mask and a sheet mask: a 4-byte “written” flag (skip the rest when 0), a 4-byte length, a 4-byte pixel depth, a 16-byte rectangle, a 2-byte pixel depth, a 1-byte compression mode (1 ZIP) and the data.
Gradient settings (grdm)
| Size | Name | Description |
|---|---|---|
| 2 | Version | 1. |
| 1 | Reversed | Boolean. |
| 1 | Dithered | Boolean. |
| varies | Name | Unicode string, padded. |
| 2 | ColorStopCount | Then for each stop: location 4, midpoint 4, mode 2, colour 8. |
| 2 | TransparencyStopCount | Then for each stop: location 4, midpoint 4, opacity 2. |
| 2 | ExpansionCount | 2. |
| 2 | Interpolation | Smoothness. |
| 2 | Length | 32. |
| 2 | Mode | Gradient mode. |
| 4 | RandomSeed | Seed for noise gradients. |
| 2 | ShowTransparency | Flag. |
| 2 | UseVectorColor | Flag. |
| 4 | Roughness | Roughness factor. |
| 2 | ColorModel | Colour model. |
| 8 | Minimum | Four 2-byte minimum colour values. |
| 8 | Maximum | Four 2-byte maximum colour values. |
| 2 | Dummy | Not used. |
Placed layers and smart objects
| Key | Contents |
|---|---|
plLd | Placed layer, replaced by SoLd in CS3: type plcL 4, version 4 (3), unique ID (Pascal string), page number 4, total pages 4, anti-alias policy 4, placed layer type 4 (0 unknown, 1 vector, 2 raster, 3 image stack), transform 64 (eight doubles: x and y of each corner), warp version 4 (0), descriptor version 4 (16), warp descriptor. |
SoLd | Placed layer data (CS3): identifier soLD 4, version 4 (4), descriptor version 4 (16), descriptor. |
SoLE | Smart object layer data (CC 2015): type soLD 4, version 4 (4 or 5), descriptor. |
lnkD, lnk2, lnk3 | Linked files of smart objects, each one a record of the shape below. |
Linked file record
| Size | Type | Name | Description |
|---|---|---|---|
| 8 | u64 | Length | Length of the record. |
| 4 | char[4] | Type | liFD data embedded, liFE external file, liFA alias. |
| 4 | u32 | Version | 1 to 7. |
| varies | Pascal string | ID | Unique ID, which SoLd refers to. |
| varies | Unicode string | FileName | Original file name. |
| 4 | char[4] | FileType | File type. |
| 4 | char[4] | Creator | File creator. |
| 8 | u64 | DataLength | Length of the data that follows. |
| 1 | bool | HasOpenDescriptor | If set, a descriptor version and the open-file descriptor follow. |
| varies | … | liFE: a linked-file descriptor; from version 4 the date (year 4, month 1, day 1, hour 1, minute 1, seconds as a double 8); an 8-byte file size; and the file’s bytes. liFA: 8 zero bytes. liFD: the embedded file’s bytes. | |
| varies | Unicode string | ChildDocumentID | Version 5 and later. |
| 8 | f64 | AssetModTime | Version 6 and later. |
| 1 | u8 | AssetLocked | Version 7 and later. |
Annotations (Anno)
A 2-byte major version (2), a 2-byte minor version (1) and a 4-byte count, then each annotation:
| Size | Name | Description |
|---|---|---|
| 4 | Length | Length of this annotation. |
| 4 | Type | txtA text, sndA sound. |
| 1 | Open | Whether the note is open. |
| 1 | Flags | Flags. |
| 2 | OptionalBlocks | 1 in Photoshop 6.0. |
| 16 | IconRect | Top, left, bottom, right of the icon. |
| 16 | PopupRect | Top, left, bottom, right of the pop-up. |
| 10 | Color | Colour. |
| varies | Author, Name, ModDate | Three Pascal strings, each padded to an even length. |
| 4 | DataBlockLength | Length of the next three fields. |
| 4 | DataKey | txtC text, sndM sound. |
| 4 | DataLength | Length of the data. |
| varies | Data | The text (ASCII or Unicode) or the sound, padded to a multiple of 4. |