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. No version field: records of 14 bytes, laid out as in display information with one more padding byte. |
| 1008 | 0x03F0 | Caption, as a Pascal string. |
| 1009 | 0x03F1 | Border information: width as a fixed number (2 bytes integer part, 2 bytes fraction), then 2 bytes units (1 inches, 2 cm, 3 points, 4 picas, 5 columns). |
| 1010 | 0x03F2 | Background colour. |
| 1011 | 0x03F3 | Print flags: a series of one-byte booleans, in this order: labels, crop marks, colour bars, registration marks, negative, flip, interpolate, caption, print flags. |
| 1012 | 0x03F4 | Greyscale and multichannel halftoning information: four screens in the layout of halftone screen below. |
| 1013 | 0x03F5 | Colour halftoning information: four screens (cyan, magenta, yellow, black) as in halftone screen. |
| 1014 | 0x03F6 | Duotone halftoning information: four screens as in halftone screen. |
| 1015 | 0x03F7 | Greyscale and multichannel transfer function: transfer functions as in transfer function below. |
| 1016 | 0x03F8 | Colour transfer functions: four transfer functions as in transfer function. |
| 1017 | 0x03F9 | Duotone transfer functions: four transfer functions as in transfer function. |
| 1018 | 0x03FA | Duotone image information. Layout not given by the specification. |
| 1019 | 0x03FB | Effective black and white values for the dot range (two bytes). |
| 1020 | 0x03FC | Obsolete. |
| 1021 | 0x03FD | EPS options. Layout not given by the specification. |
| 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 to Photoshop: a 2-byte signed quality (−3 to 12; add 4 for the 1 to 12 of the Save As dialog), a 2-byte format (0 standard, 1 optimised, 257 progressive) and a 2-byte count of progressive scans (1 is 3 scans, 2 is 4, 3 is 5). |
| 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: a 4-byte version, a 4-byte length, then data. Files are seen with a length of 0 and 14 more bytes after it; the layout of the data is not given. |
| 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: 2 bytes major version, 2 bytes minor version, 4 bytes count; then for each entry 4 bytes block size, 4 bytes key, and either a boolean dirty flag (key jtDd) or a 4-byte modification date (any other key). |
| 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: 2 bytes version (1), 2 bytes count, that many 10-byte colours (2-byte space, four 2-byte components), then a 2-byte count (usually 256) of Lab colours, one byte each for L, a and b. Not read or used by Photoshop. |
| 1067 | 0x042B | Alternate spot colours: 2 bytes version (1), 2 bytes channel count, then for each channel a 4-byte channel ID and a 10-byte colour. Not read or used by Photoshop. |
| 1069 | 0x042D | Layer selection IDs: a 2-byte count, then a 4-byte layer ID for each selected layer. |
| 1070 | 0x042E | HDR toning information. Layout not given by the specification. |
| 1071 | 0x042F | Print information. Layout not given by the specification. |
| 1072 | 0x0430 | Layer groups enabled IDs: one byte for each layer. |
| 1073 | 0x0431 | Colour samplers, current format (1038 holds the old one). Layout in colour samplers below. |
| 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. Replaces 1007. A 4-byte version (1), then 13-byte records (below). |
| 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. |
| 1092 | 0x0444 | Grid and guides with a colour for every guide (not in Adobe’s specification; layout from ag-psd): the layout of 1032 with version 2, and each guide is a 4-byte location (32 units to a pixel), a direction byte (0 vertical, 1 horizontal), one unused byte and a red, green and blue byte. |
| 1097 | 0x0449 | Guide identifiers (not in Adobe’s specification; layout from ag-psd): a 4-byte count, then for each guide a length-prefixed ASCII identifier, a 4-byte number (always 0) and a length-prefixed ASCII GUID (always empty in the files ag-psd read). |
| 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: 2 bytes version (1), 1 byte centre crop marks, 1 byte (0), 4 bytes bleed width value, 2 bytes bleed width scale. |
IDs 1004, 1031, 1048, 1055, 1056, 1063, 1068, 1079 and 1081 are not assigned in the specification.
ResolutionInfo (1005)
Sixteen bytes: a resolution and two units for each direction. The resolutions are 16.16
fixed-point numbers (72 pixels per inch is 00 48 00 00). Files written by
Photoshop show the pattern 00 48 00 00 00 01 00 02 00 48 00 00 00 01 00 02: 72 pixels per inch,
with the width and height shown in centimetres.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | u32 | hRes | Horizontal resolution, 16.16 fixed point: divide by 65536 for pixels per inch or per cm, as hResUnit says. |
| 4 | 2 | u16 | hResUnit | The unit of the resolution: 1 pixels per inch, 2 pixels per centimetre. |
| 6 | 2 | u16 | widthUnit | The unit the width is shown in: 1 inches, 2 centimetres, 3 points, 4 picas, 5 columns. |
| 8 | 4 | u32 | vRes | Vertical resolution, as hRes. |
| 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 | u32 | Location | Position in document coordinates, 32 units to a pixel (the grid values above are in the same unit: 576 is 18 pixels). |
| 4 | 1 | u8 | Direction | 0 vertical, 1 horizontal. |
Display information (1007, 1077)
One record for each channel that is not a colour channel of the mode. Resource 1077 starts with a 4-byte version (1). Resource 1007 has no version and one more byte in each record.
| Size | Type | Name | Description |
|---|---|---|---|
| 2 | u16 | ColourSpace | The colour space (see colour spaces). |
| 8 | 4 × u16 | Colour | The channel’s colour components. |
| 2 | u16 | Opacity | 0 to 100. |
| 1 | u8 | Kind | 0 the colour marks the masked area, 1 the colour marks the selected area, 2 a spot colour. |
| 1 | u8 | Padding | Only in resource 1007. |
Halftone screens (1012, 1013, 1014)
Four screens of 18 bytes each (the layout of the halftone screens settings file).
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | 16.16 | Frequency | Lines per unit, 1.0 to 999.999. |
| 2 | u16 | Unit | 1 lines per inch, 2 lines per centimetre. Affects the display only. |
| 4 | 16.16 | Angle | −180 to 180 degrees. |
| 2 | s16 | Shape | 0 round, 1 ellipse, 2 line, 3 square, 4 cross, 6 diamond. A negative number is a custom spot function whose size in bytes is its absolute value. |
| 4 | u32 | Unused | 0. |
| 1 | boolean | AccurateScreens | 1 use accurate screens. |
| 1 | boolean | PrinterDefault | 1 use the printer’s default screens. |
The PostScript text of any custom spot functions follows the four screens.
Transfer functions (1015, 1016, 1017)
Each is 28 bytes: 13 signed 16-bit values and a 16-bit override.
| Size | Type | Name | Description |
|---|---|---|---|
| 26 | 13 × s16 | Curve | 0 to 1000 for 0.0 to 100.0 percent. Every value but the first and last may be −1, which means no point. A null curve is 0, then −1 eleven times, then 1000. |
| 2 | u16 | Override | 0 lets the printer supply the curve, 1 overrides the printer’s curve. |
Colour samplers (1038, 1073)
An 8-byte header, then one block per sampler.
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | Version | 1, 2 or 3. |
| 4 | u32 | Count | Number of samplers. |
| Size | Type | Name | Description |
|---|---|---|---|
| 4 | u32 | SamplerVersion | Version 3 only: 1. |
| 8 | 2 × 4 | Position | Horizontal and vertical position, 4 bytes each: fixed point in version 1, float in version 2. |
| 2 | s16 | ColorSpace | −1 dummy, 0 RGB, 1 HSB, 2 CMYK, 3 Pantone, 4 Focoltone, 5 Trumatch, 6 Toyo, 7 Lab, 8 Gray, 9 WideCMYK, 10 HKS, 11 DIC, 12 TotalInk, 13 MonitorRGB, 14 Duotone, 15 Opacity, 16 Web, 17 GrayFloat, 18 RGBFloat, 19 OpacityFloat. |
| 2 | u16 | Depth | Version 2 only. |
The specification gives the colour space as a C enumeration starting at −1; the numbers above follow from it.
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.