An adjustment or fill layer (Photoshop 4.0 and later) is a layer whose tagged blocks include one of the keys below; its channel data is undefined (the specification says probably all white). Adobe’s “Photoshop File Formats Specification” says the data of an adjustment layer is the same as the settings (“load”) file Photoshop saves from that adjustment’s dialog, and describes those files in its “Additional File Formats” chapter. Some adjustments have their own layout in the tagged-block chapter instead, and four have none at all. All numbers are big-endian; “short” is a signed 16-bit integer.
Keys
| Key | Adjustment | Layout |
|---|---|---|
SoCo | Solid colour fill | 4-byte version (16), descriptor. |
GdFl | Gradient fill | 4-byte version (16), descriptor. |
PtFl | Pattern fill | 4-byte version (16), descriptor. |
brit | Brightness/Contrast | Below. |
levl | Levels | Levels file. |
curv | Curves | Curves file. |
expA | Exposure | Below. |
vibA | Vibrance (CS3) | 4-byte descriptor version (16), descriptor. |
hue | Hue/Saturation, Photoshop 4.0 | Hue/saturation file, 4.0 value ranges. |
hue2 | Hue/Saturation, Photoshop 5.0 | Hue/saturation file, 5.0 value ranges. |
blnc | Color Balance | Not documented: the specification has no Color Balance settings file. |
blwh | Black and White (CS3) | 4-byte descriptor version (16), descriptor. |
phfl | Photo Filter | Below. |
mixr | Channel Mixer | Below. |
clrL | Color Lookup (CS6) | 2-byte version (1), 4-byte descriptor version (16), descriptor. (The specification calls the descriptor “black and white information”, apparently copied from blwh.) |
nvrt | Invert | Not described by the specification. |
post | Posterize | Not documented: no Posterize settings file is described. |
thrs | Threshold | Not documented: no Threshold settings file is described. |
grdm | Gradient Map | Gradient settings. |
selc | Selective Color | Selective colour file. |
The specification describes no difference between a load file and the corresponding block, so the layouts below are those of the load files.
Brightness/Contrast (brit)
| Size | Name | Description |
|---|---|---|
| 2 | Brightness | Brightness. |
| 2 | Contrast | Contrast. |
| 2 | Mean | Mean value for brightness and contrast. |
| 1 | LabOnly | Lab colour only. |
Levels (levl)
The Levels settings file (Mac type 8BLS, Windows .ALV):
| Size | Name | Description |
|---|---|---|
| 2 | Version | 2. |
| 29 × 10 | Records | 29 level records, below. |
| Size | Name | Description |
|---|---|---|
| 2 | InputFloor | 0 to 253. |
| 2 | InputCeiling | 2 to 255. |
| 2 | OutputFloor | 0 to 255, matched to the input floor. |
| 2 | OutputCeiling | 0 to 255. |
| 2 | Gamma | 10 to 999, meaning 0.10 to 9.99. |
- Record 1 is the master, for all composite channels (RGB) in composite mode; record 2 applies to channel 1, record 3 to channel 2, and so on up to record 25 for channel 24.
- Indexed colour: record 1 is the master, records 2 to 4 are for the red, green and blue of the colour table and apply to the first channel, and the rest apply to active alpha channels (record 5 to channel 2, and so on).
- Records 28 and 29 are reserved and zero.
- With a single active channel, its settings are stored in the master record.
Photoshop CS (8.0) adds, after the version 2 data:
| Size | Name | Description |
|---|---|---|
| 4 | Marker | Lvls. |
| 2 | Version | 3. |
| 2 | Count | Total number of level records; subtract the 29 already read to get the number that follow. |
| varies | Records | The further 10-byte level records. |
Curves (curv)
The Curves settings file (Mac type 8BSC; the specification’s table gives
the Windows extension .CRV, while its text says curves are saved as
.ATF and .ACV files):
| Size | Name | Description |
|---|---|---|
| 2 | Version | 1 or 4. |
| 2 | Curves | Version 1: a bit map of the curves present. Version 4: the number of curves. |
Then each curve:
| Size | Name | Description |
|---|---|---|
| 2 | PointCount | 2 to 19. |
| count × 4 | Points | Pairs of shorts: output (vertical on the graph), then input; 0 to 255. |
- A null curve, which changes nothing, is the five shorts
2 0 0 255 255. - Curve 1 is the master for the composite channels; curve 2 applies to channel 1, up to curve 17 for channel 16.
- Indexed colour (hence up to 19 curves): curve 1 is the master, curves 2 to 4 are for the colour table’s red, green and blue and apply to the first channel, and the rest to active alpha channels, up to curve 19 for channel 16.
- With a single active channel, its curve is stored as the master.
- Ink percentages in the dialog are display only: 100% ink is data 0, 0% ink is 255.
At the end of a version 1 file:
| Size | Name | Description |
|---|---|---|
| 4 | Marker | Crv (with a space). |
| 2 | Version | 4. |
| 4 | Count | Number of curves that follow. |
| 2 | Channel | For each curve: its channel index, then the point count and points as above. |
Exposure (expA)
| Size | Name | Description |
|---|---|---|
| 2 | Version | 1. |
| 4 | Exposure | Exposure. |
| 4 | Offset | Offset. |
| 4 | Gamma | Gamma. |
The specification gives the three values’ sizes but not their number type.
Hue/Saturation (hue , hue2)
The Hue/Saturation settings file (Mac type 8BHA, Windows
.AHU):
| Size | Name | Description |
|---|---|---|
| 2 | Version | 2. |
| 1 | Mode | 0 use the hue-adjustment settings, 1 use the colourisation settings. |
| 1 | Padding | Present, ignored. |
| 6 | Colorization | Hue, saturation and lightness as three shorts. |
| 6 | Master | Master hue, saturation and lightness. |
| 6 × 14 | Ranges | Six sets of 4 range values (8 bytes) followed by 3 settings values (6 bytes). |
- Photoshop 5.0 (
hue2) stores the actual values: hue −180 to 180, saturation 0 to 100, lightness −100 to 100. - Photoshop 4.0 (
hue) stores all three as −100 to 100, shown to the user as hue −180 to 180, saturation 0 to 100 and lightness −100 to 100, with red at 0. - For RGB and CMYK the six sets are the six hextants of the colour wheel: pixels nearest red, yellow, green, cyan, blue and magenta. The range values are shown as −60 to 60, but the slider covers all 201 values from −100 to 100.
- For Lab the first four sets are the four quadrants (yellow, green, blue, magenta) and the other two are ignored (0).
Photo Filter (phfl)
| Size | Name | Description |
|---|---|---|
| 2 | Version | 3 or 2. |
| 12 | XYZ | Version 3 only: X, Y and Z, 4 bytes each. |
| 10 | Color | Version 2 only: 2-byte colour space and four 2-byte components. |
| 4 | Density | Density. |
| 1 | PreserveLuminosity | Preserve luminosity. |
Channel Mixer (mixr)
| Size | Name | Description |
|---|---|---|
| 2 | Version | 1. |
| 2 | Monochrome | Monochrome. |
| 20 | Settings | “RGB or CMYK color plus constant for the mixer settings. 4 × 2 bytes of color with 2 bytes of constant.” |
Four colour values and a constant make 10 bytes, half of the 20 given; the specification does not say how the 20 bytes are divided between output channels.
Selective Color (selc)
The Selective Color settings file (Mac type 8BSV, Windows
.ASV):
| Size | Name | Description |
|---|---|---|
| 2 | Version | 1. |
| 2 | Method | 0 relative, 1 absolute correction. |
| 10 × 8 | Plates | Ten plate-correction records. The first is reserved and zero; the rest are for reds, yellows, greens, cyans, blues, magentas, whites, neutrals and blacks. |
Each plate-correction record is four shorts from −100 to 100: cyan, magenta, yellow and black correction.
Source
- Adobe Photoshop File Formats Specification – Adobe’s HTML specification, sections “Additional Layer Information” and “Additional File Formats”