The image resources section follows the colour mode data. It holds settings that belong to the document rather than to a layer: resolution, guides, the thumbnail, colour profile, metadata, saved paths and many more. Each setting is a resource block with a numeric ID. A reader can skip any block it does not know, because each one gives its own size.
Section layout
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | Length | Total length of the resource blocks that follow. May be 0. |
| Length | blocks | Resources | Resource blocks, one after another. |
Resource block
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | char[4] | Signature | 8BIM. |
| 2 | u16 | ID | Resource ID, from the table below. |
| varies | Pascal string | Name | A length byte and that many characters, padded so the whole name is an even number of bytes. Usually empty, stored as two zero bytes. |
| 4 | u32 | Size | Size of the data that follows, not counting padding. |
| Size | bytes | Data | The resource data, padded with a zero byte to an even length. |
38 42 49 4D 04 0D 00 00 00 00 00 04 00 00 00 1E
0x040D, global lighting angle) with an empty name, 4 bytes of data: 30 degreesResource IDs
Every ID in Adobe’s specification. IDs it marks obsolete are still met in old files.
| ID | Hex | Contents |
|---|---|---|
| 1000 | 0x03E8 | Obsolete (Photoshop 2.0): number of channels, rows, columns, depth and mode. |
| 1001 | 0x03E9 | Macintosh print manager print info record. |
| 1002 | 0x03EA | Obsolete: Macintosh page format information. |
| 1003 | 0x03EB | Obsolete (Photoshop 2.0): indexed colour table. |
| 1005 | 0x03ED | Resolution information (ResolutionInfo, below). |
| 1006 | 0x03EE | Names of the alpha channels, as a series of Pascal strings. |
| 1007 | 0x03EF | Obsolete: display information for each channel; replaced by 1077. |
| 1008 | 0x03F0 | Caption, as a Pascal string. |
| 1009 | 0x03F1 | Border information: width and units. |
| 1010 | 0x03F2 | Background colour. |
| 1011 | 0x03F3 | Print flags: labels, crop marks, colour bars, registration marks, negative, flip, interpolate, caption, print flags. |
| 1012 | 0x03F4 | Greyscale and multichannel halftoning information. |
| 1013 | 0x03F5 | Colour halftoning information. |
| 1014 | 0x03F6 | Duotone halftoning information. |
| 1015 | 0x03F7 | Greyscale and multichannel transfer function. |
| 1016 | 0x03F8 | Colour transfer functions. |
| 1017 | 0x03F9 | Duotone transfer functions. |
| 1018 | 0x03FA | Duotone image information. |
| 1019 | 0x03FB | Effective black and white values for the dot range (two bytes). |
| 1020 | 0x03FC | Obsolete. |
| 1021 | 0x03FD | EPS options. |
| 1022 | 0x03FE | Quick Mask information: channel ID and whether the mask was initially empty. |
| 1023 | 0x03FF | Obsolete. |
| 1024 | 0x0400 | Layer state: index of the target layer, 0 being the bottom layer (2 bytes). |
| 1025 | 0x0401 | Working path, not saved. |
| 1026 | 0x0402 | Layer group information: a 2-byte group ID for each layer, used when dragging groups. |
| 1027 | 0x0403 | Obsolete. |
| 1028 | 0x0404 | IPTC-NAA record (File Info). |
| 1029 | 0x0405 | Image mode for raw format files. |
| 1030 | 0x0406 | JPEG quality. Private. |
| 1032 | 0x0408 | Grid and guides information (below). |
| 1033 | 0x0409 | Thumbnail, Photoshop 4.0 (BGR order). |
| 1034 | 0x040A | Copyright flag: whether the image is marked as copyrighted (boolean). |
| 1035 | 0x040B | URL, as text. |
| 1036 | 0x040C | Thumbnail, Photoshop 5.0 and later (RGB order). |
| 1037 | 0x040D | Global lighting angle for effects: 4-byte integer, 0 to 359. Assumed to be 30 when absent. |
| 1038 | 0x040E | Obsolete: colour samplers in the old format. |
| 1039 | 0x040F | ICC colour profile, the raw profile bytes. |
| 1040 | 0x0410 | Watermark: one byte. |
| 1041 | 0x0411 | ICC untagged profile: one byte, 1 means the image is deliberately untagged. |
| 1042 | 0x0412 | Effects visible: one byte, 1 shows all layer effects, 0 hides them. |
| 1043 | 0x0413 | Spot halftone: 4-byte version, 4-byte length, then that much data. |
| 1044 | 0x0414 | Document-specific ID seed number: the base value from which new layer IDs are made (4 bytes). |
| 1045 | 0x0415 | Unicode alpha channel names, as Unicode strings. |
| 1046 | 0x0416 | Indexed colour table count: number of colours in the table that are defined (2 bytes). |
| 1047 | 0x0417 | Transparency index: index of the transparent colour, if any (2 bytes). |
| 1049 | 0x0419 | Global altitude for effects (4 bytes). |
| 1050 | 0x041A | Slices (below). |
| 1051 | 0x041B | Workflow URL, as a Unicode string. |
| 1052 | 0x041C | Jump To XPEP: version, count and a list of key and value pairs. |
| 1053 | 0x041D | Alpha identifiers: 4 bytes per alpha channel. |
| 1054 | 0x041E | URL list (below). |
| 1057 | 0x0421 | Version information (below). |
| 1058 | 0x0422 | EXIF data 1. |
| 1059 | 0x0423 | EXIF data 3. |
| 1060 | 0x0424 | XMP metadata, as XML text. |
| 1061 | 0x0425 | Caption digest: a 16-byte MD5 of the caption. |
| 1062 | 0x0426 | Print scale (below). |
| 1064 | 0x0428 | Pixel aspect ratio (below). |
| 1065 | 0x0429 | Layer comps: a 4-byte descriptor version (16) and a descriptor. |
| 1066 | 0x042A | Alternate duotone colours. Not used. |
| 1067 | 0x042B | Alternate spot colours. Not used. |
| 1069 | 0x042D | Layer selection IDs: a 2-byte count, then a 4-byte layer ID for each selected layer. |
| 1070 | 0x042E | HDR toning information. |
| 1071 | 0x042F | Print information. |
| 1072 | 0x0430 | Layer groups enabled IDs: one byte for each layer. |
| 1073 | 0x0431 | Colour samplers, current format (1038 holds the old one). |
| 1074 | 0x0432 | Measurement scale: descriptor version (16) and a descriptor. |
| 1075 | 0x0433 | Timeline information: descriptor version (16) and a descriptor. |
| 1076 | 0x0434 | Sheet disclosure: descriptor version (16) and a descriptor. |
| 1077 | 0x0435 | Display information for each channel, with floating-point colours. Replaces 1007. |
| 1078 | 0x0436 | Onion skins: descriptor version (16) and a descriptor. |
| 1080 | 0x0438 | Count information for the count tool: descriptor version (16) and a descriptor. |
| 1082 | 0x043A | Print settings and colour management: descriptor version (16) and a descriptor. |
| 1083 | 0x043B | Print style: crop marks, labels and similar, as a descriptor. |
| 1084 | 0x043C | Macintosh NSPrintInfo. |
| 1085 | 0x043D | Windows DEVMODE. |
| 1086 | 0x043E | Auto-save file path, as a Unicode string. |
| 1087 | 0x043F | Auto-save format, as a Unicode string. |
| 1088 | 0x0440 | Path selection state: descriptor version (16) and a descriptor. |
| 2000–2997 | 0x07D0–0x0BB6 | Saved paths. The resource name is the path’s name; the data is path records. |
| 2999 | 0x0BB7 | Name of the clipping path, which is one of the saved paths. |
| 3000 | 0x0BB8 | Origin path information: descriptor version (16) and a descriptor. |
| 4000–4999 | 0x0FA0–0x1387 | Resources added by plug-ins. Their content is private to each plug-in. |
| 7000 | 0x1B58 | ImageReady variables, as XML. |
| 7001 | 0x1B59 | ImageReady data sets. |
| 7002 | 0x1B5A | ImageReady default selected state. |
| 7003 | 0x1B5B | ImageReady 7 rollover expanded state. |
| 7004 | 0x1B5C | ImageReady rollover expanded state. |
| 7005 | 0x1B5D | ImageReady save layer settings. |
| 7006 | 0x1B5E | ImageReady version. |
| 8000 | 0x1F40 | Lightroom workflow: present when the document is part of a Lightroom workflow. |
| 10000 | 0x2710 | Print flags information: version, centre crop marks, bleed width and its scale. |
IDs 1004, 1031, 1048, 1055, 1056, 1063, 1068, 1079 and 1081 are not assigned in the specification.
ResolutionInfo (1005)
Adobe’s file format specification refers to its plug-in SDK for this structure. The 16-byte layout below is the one that Photoshop writes and that readers such as ImageMagick and psd-tools use.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | fixed 16.16 | hRes | Horizontal resolution in pixels per inch. |
| 4 | 2 | u16 | hResUnit | Unit shown to the user: 1 pixels per inch, 2 pixels per centimetre. |
| 6 | 2 | u16 | widthUnit | 1 inches, 2 centimetres, 3 points, 4 picas, 5 columns. |
| 8 | 4 | fixed 16.16 | vRes | Vertical resolution in pixels per inch. |
| 12 | 2 | u16 | vResUnit | As hResUnit. |
| 14 | 2 | u16 | heightUnit | As widthUnit. |
Thumbnail (1033, 1036)
A 28-byte header followed by the picture. Resource 1036 stores the colours in RGB order; the older 1033 in BGR order.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | u32 | Format | 1 JPEG (kJpegRGB), 0 raw RGB (kRawRGB). |
| 4 | 4 | u32 | Width | Width in pixels. |
| 8 | 4 | u32 | Height | Height in pixels. |
| 12 | 4 | u32 | WidthBytes | Padded row bytes: (Width × BitsPerPixel + 31) / 32 × 4. |
| 16 | 4 | u32 | TotalSize | WidthBytes × Height × Planes. |
| 20 | 4 | u32 | CompressedSize | Size after compression; used to check consistency. |
| 24 | 2 | u16 | BitsPerPixel | 24. |
| 26 | 2 | u16 | Planes | 1. |
| 28 | rest | bytes | Data | The JFIF (JPEG) stream. |
Grid and guides (1032)
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | u32 | Version | 1. |
| 4 | 4 | u32 | GridHorizontal | Horizontal grid spacing, currently fixed at 576, a grid line every quarter inch at 72 dpi. |
| 8 | 4 | u32 | GridVertical | Vertical grid spacing, also 576. |
| 12 | 4 | u32 | GuideCount | Number of guide entries that follow. May be 0. |
Each guide is 5 bytes:
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | s32 | Location | Position in document coordinates. |
| 4 | 1 | u8 | Direction | 0 vertical, 1 horizontal. |
Version information (1057)
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | Version | Version of this resource. |
| 1 | u8 | HasRealMergedData | 1 when the image data section holds a true composite. A file saved without “maximise compatibility” has 0 here. |
| varies | Unicode string | WriterName | Name of the program that wrote the file. |
| varies | Unicode string | ReaderName | Name of the program the file is meant for. |
| 4 | u32 | FileVersion | File version. |
Print scale (1062)
| Size | Type | Name | Description |
|---|---|---|---|
| 2 | u16 | Style | 0 centred, 1 size to fit, 2 user defined. |
| 4 | f32 | X | Horizontal position. |
| 4 | f32 | Y | Vertical position. |
| 4 | f32 | Scale | Scale. |
Pixel aspect ratio (1064)
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | Version | 1 or 2. Version 2 corrects the NTSC and PAL ratios, which were about 5% off in version 1. |
| 8 | f64 | Ratio | Pixel width divided by pixel height. |
URL list (1054)
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | Count | Number of URLs. |
| 4 | u32 | Long | For each URL: a 4-byte value (unnamed in the specification). |
| 4 | u32 | ID | For each URL: its ID. |
| varies | Unicode string | URL | For each URL: the address. |
Slices (1050)
Versions 7 and 8 store a 4-byte version, a 4-byte descriptor version (16) and a descriptor. Version 6 has a binary layout:
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | Version | 6. |
| 16 | s32[4] | Bounds | Top, left, bottom, right of all the slices. |
| varies | Unicode string | GroupName | Name of the group of slices. |
| 4 | u32 | Count | Number of slices that follow. |
Each version 6 slice:
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | ID | Slice ID. |
| 4 | u32 | GroupID | Group ID. |
| 4 | u32 | Origin | How the slice was made. When it is 1, an associated layer ID follows. |
| 4 | u32 | LayerID | Only when Origin is 1: the layer the slice was made from. |
| varies | Unicode string | Name | Slice name. |
| 4 | u32 | Type | Slice type. |
| 16 | s32[4] | Bounds | Left, top, right, bottom. |
| varies | Unicode string | URL | Link address. |
| varies | Unicode string | Target | Link target. |
| varies | Unicode string | Message | Status message. |
| varies | Unicode string | AltTag | Alternative text. |
| 1 | bool | CellTextIsHTML | Whether the cell text is HTML. |
| varies | Unicode string | CellText | Cell text. |
| 4 | u32 | HorizontalAlignment | Horizontal alignment. |
| 4 | u32 | VerticalAlignment | Vertical alignment. |
| 4 | u8[4] | Colour | Alpha, red, green, blue. |
| varies | descriptor | Extra | If the resource length allows: a 4-byte descriptor version (16) and a descriptor. |
The specification does not list the values of Origin, Type
or the two alignment fields.