In creating the ASE Palette Converter, I had to reverse-engineer the contents of proprietary Adobe ASE Adobe Swatch Exchange files. As with anything reverse-engineered, the following file format spec is only my best-guess of the actual, official Adobe ASE file specification. For instance, a field which I indicate is a four-byte field might be perhaps just a two-byte integer with two bytes of unused space.
In addition, this file spec only covers solid color palettes. The ASE file format may support gradients, but gradients are not covered below.
I've been aided by articles and posts written by other folks on this topic whom I gratefully acknowledge here.
- Joergen Bech's post in the Adobe Forums
- Darius Monsef's article on his ColourLovers] site
- Adobe's Kuler palette tool
I'd also like to acknowledge Robert Nyman who kindly exported several palettes from Adobe CS2 for me to study.
ASE File Specification
All disclaimers apply: this file spec is provided as-is with no guarantee or warranty; file specification is subject to change without notice; your results may vary; don't operate heavy machinery while studying this, etc etc etc. For my purposes, however, this has served me well and if you can benefit from it, all the better.
ASEFILE: HEAD [ASECHUNK]
The ASE file consists of one HEAD record and one or more ASECHUNK records
HEAD: ASEF VER ASECHUNKCOUNT
ASEF: 0x41534546 VER: 0x00010000 (1.0)
The HEAD record consists of a four-byte file identifier consisting of the ASCII letters "ASEF" followed two double-byte integer fields indicating the file version and finally a four-byte integer field that holds the number of ASECHUNK records to follow.
ASECHUNK: CHUNKTYPE CHUNK
An ASECHUNK consists of a four-byte CHUNKTYPE indicator followed by a variable-length CHUNK. There are three chunk types:
CHUNKTYPE: 0xC0010000 palette name chunk CHUNKTYPE: 0x00010000 swatch chunk CHUNKTYPE: 0x00000000 final chunk
ASE files generated by colourlovers.com contain only swatch (color) chunks and do not contain palette name chunks. Kuler generates a palette chunk with the name of the palette.
CHUNK: CHUNKSIZE CHUNKDATA
The CHUNK consists of a two-byte integer field containing the length of CHUNKDATA that follows.
CHUNKDATA: CHARCOUNT CHARS [COLORDATA]
CHUNKDATA consists of a two-byte integer indicating the number of characters in this palette/swatch name, depending on the CHUNKTYPE. This is followed by CHARCOUNT double-byte character (eg
0x00410042 == "AB") string ending with double-byte null character
0x0000. The variable-length string is optionally followed by a variable-length COLORDATA field.
Note: Palette CHUNKDATAs do not contain COLORDATA. Palette names allow you to have, for instance three named colors SunSunSunny, Azure Sky, and Mediterranean Mango all grouped into a palette named Athens Awaits.
COLORDATA: CSPACE VAL [VAL] EOD
COLORDATA consists of a four-byte colorspace indicator (RGB, CMYK, Gray, LAB) followed by a series of IEE754 floating-point color values, followed by a two-byte end-of-data marker.
- Gray COLORDATA consists of a four-byte CSPACE value "GRAY" followed by one VAL
- RGB COLORDATA consists of a four-byte CSPACE value of "RGB " followed by three VALs
- CMYK COLORDATA consists of a four-byte CSPACE value of "CMYK" followed by four VALs
- LAB COLORDATA consists of a four-byte CSPACE value of "LAB " followed by three VALs
Spaces in the RGB and LAB CSPACE fields are hexadecimal
VALs are IEEE754 floating-point values between 0 and 1 inclusive. Think of these values as percentages. CMYK values are normally between 0 and 100 so multiply those floating-point values by 100. RGB values lie between 0 and 255 so multiply the percentage values by 255 to convert to the proper RGB scale. Gray is represented by a single value in the RGB colorspace. Multiply this single number by 255 and use it for all three RGB values.
The color values are followed by a two-byte end-of-data marker,
Kuler does not export in HSB format, so it is unclear whether the ASE format supports it directly. When I save my Kuler swatch with the HSB colorspace selected, Kuler will export it to an ASE file with RGB values.
I have not pursued understanding Adobe LAB color values, but it is included in the specification for completeness. These values range above and below zero so there would need some sort of multiplier, but what that multiplier is, I am unaware.