Decorative clipping of ACO format

Adobe Photoshop 7 Color File Format

ACO Files

In Adobe Photoshop, the active swatches palette can be saved to, or loaded from, an ACO (Adobe COlor) file.

  • In Mac OS X and Windows, the file extension of an ACO file is '.aco'.

  • In Mac OS 9 and below, the file type is '8BCO'.

Two versions of the palette format exist:

  • A version 1 palette lists the coordinates of each color in a specified color space.

  • A version 2 palette lists both the coordinates and the name of each color.

The name is what you see displayed as a rollover when the mouse cursor hovers over the color in the palette.

When saving an ACO file, Photoshop releases prior to 7.0 wrote only a version 1 palette. When loading an ACO file today, these old versions of Photoshop read the version 1 palette and ignore any version 2 palette that may be present.

Photoshop 7.0 writes a version 1 palette followed by a version 2 palette. When loading an ACO file, it reads the version 2 palette, if present. Otherwise, it reads the version 1 palette.

Palettes

Each palette in an ACO file is a series of 16-bit big-endian words.

Macs are big-endian. On Wintel machines, it is necessary to swap the bytes of each 16-bit word.

The palette begins with a two-word header:

version (0 or 1)
nc (number of colors)

The header is followed by nc color specs. In a version 1 ACO file, each color spec occupies five words:

color space
w
x
y
z

In a version 2 ACO file, those five words are followed by the color name in the following format:

0
len + 1
len words (UTF-16 representation of the name)
0

Example: The name "A2" appears as hexadecimal 00 03 41 62 00 (ASCII "A2" = 4162; len=2, len+1=3).

Color Specs

The table below describes the process for converting a color spec (three or four 16-bit values) to its Photoshop color picker equivalent (three or four 8-bit values).

Example:

 range: 0..65535
H[0..360°)=w/182.04

Interpretation:

  1. The range of values for this 16-bit word is 0 to 65535, inclusive.

    • When the range begins with 0, the word is an unsigned int.

    • When the range begins with a negative number, the word is a signed int.

  2. The color coordinate H is determined by this word. In the Photoshop color picker, H ranges from 0° inclusive to 360° exclusive. To calculate a value of H in the color picker's range, divide w by 182.04.

    • The mathematical notation [...] denotes a closed interval that includes the values adjacent to the brackets.

    • The notation [...) denotes a half-open interval that excludes the value adjacent to the parenthesis.

    • The Photoshop color picker rounds fractions down to whole numbers.

# Name w x y z
0
 RGB
 range: 0..65535
R[0..256)=w/256
 range: 0..65535
G[0..256)=x/256
 range: 0..65535
B[0..256)=y/256
0
1
 HSB
 range: 0..65535
H[0..360°)=w/182.04
 range: 0..65535
S[0..100%]=x/655.35
 range: 0..65535
B[0..100%]=y/655.35
0
2
 CMYK
 range: 0..65535
C[0..100%]=100-w/655.35
 range: 0..65535
M[0..100%]=100-x/655.35
 range: 0..65535
Y[0..100%]=100-y/655.35
 range: 0..65535
K[0..100%]=100-z/655.35
7
 Lab
 range: 0..10000
L*[0..100]=w/100
 range: -12800..12700
a*[-128..127]=x/100
 range: -12800..12700
b*[-128..127]=y/100
0
8
 Grayscale
 range: 0..10000
R,G,B[0..256)=w/39.0625
0
0
0
9
 Wide CMYK
 range: 0..10000
C[0..100%]=w/100
 range: 0..10000
M[0..100%]=x/100
 range: 0..10000
Y[0..100%]=y/100
 range: 0..10000
K[0..100%]=z/100

In addition to the above, Photoshop 7.0 can read color spaces #13 and #15. I have not been able to identify these two spaces.

Photoshop 7.0 can not read color spaces #3-6, #10-12, #14. Plug-ins may be available that can read these and other color spaces.

Information sources

I deduced the format of ACO files by conducting experiments and by reading the following published sources:

  • Reverse-Engineering of the Adobe Color File Format by Chris Berry.

  • Adobe Photoshop File Formats Specification by Adobe Systems Incorporated and Thomas Knoll.

For information about the format of Adobe Color Book (ACB) files, see: The Unofficial Photoshop Color Book File Format Specification by Ates Goral.

This page was contributed to the public domain by Larry Tesler, 9-Oct-2004.