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 | Below. |
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 | No settings: the block has no data (below). |
post | Posterize | Below. |
thrs | Threshold | Below. |
grdm | Gradient Map | Gradient settings. |
selc | Selective Color | Selective colour file. |
Where a block is the same as a load file, the layout below is the load file’s. The blocks are padded to a multiple of 2 or 4 bytes, so up to three zero bytes can follow the data.
Brightness/Contrast (brit)
| Size | Name | Description |
|---|---|---|
| 2 | Brightness | Signed 16-bit brightness. |
| 2 | Contrast | Signed 16-bit contrast. |
| 2 | Mean | Unsigned 16-bit mean value for brightness and contrast. |
| 1 | LabOnly | Lab colour only: a boolean. |
| 1 | Padding | Zero. |
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. |
In a curv block the same data is preceded by one byte (0, or 1 when the curves are lookup tables of
256 bytes instead of point lists) and the bit map or count is 4 bytes, so the block starts with a 1-byte flag,
a 2-byte version (1 or 4) and a 4-byte bit map or count. A block of version 1 with the bit map 9 (bits 0 and
3) holds two curves, for the composite and for channel 3. The block is padded to a multiple of four bytes.
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, a 32-bit floating-point number. |
| 4 | Offset | Offset, a 32-bit float. |
| 4 | Gamma | Gamma, a 32-bit float. |
| 2 | Padding | Zero. |
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). |
| 36 | Further | Photoshop writes 36 more bytes: six triples of 16-bit values, one for each range, which look like a hue, 100 and 50. Adobe does not describe them; older files end after the ranges. |
- 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. |
| 40 | Outputs | Four output channels of 10 bytes each: five signed shorts (the share, in percent, of the red or cyan, green or magenta, blue or yellow and black source channels, then a constant). An RGB document uses the first three outputs; the fourth is the black output of CMYK. The identity mixer is 100 on the diagonal. |
Photoshop writes 44 bytes: the 4 above and four 10-byte output rows. (Adobe’s specification gives one 20-byte field.)
Color Balance (blnc)
| Size | Name | Description |
|---|---|---|
| 6 | Shadows | Three signed shorts, −100 to 100: cyan to red, magenta to green, yellow to blue. |
| 6 | Midtones | The same three values. |
| 6 | Highlights | The same three values. |
| 1 | PreserveLuminosity | A boolean. |
| 1 | Padding | Zero. |
Invert (nvrt)
The block has no data: its length is 0. The adjustment has no settings.
Posterize (post)
| Size | Name | Description |
|---|---|---|
| 2 | Levels | The number of levels, 2 to 255. |
| 2 | Padding | Zero. |
Threshold (thrs)
| Size | Name | Description |
|---|---|---|
| 2 | Level | The threshold level, 1 to 255. |
| 2 | Padding | Zero. |
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”