I need to export a Photoshop swatch file to a human-readable document with RGB, HSB, HEX values and the name of the swatch. Is there any tool which can export swatches to this kind of a document?


I have made a limited (no support for LAB, HSB or spot color at the moment) python aco -> text dumper. The script itself is a one off quickly done one so you need to change the file name to read or name your out file test.aco:

# -*- coding: utf-8 -*-
# quick script no warranties whatsoever
import struct

class ColorSwatch():
    def __init__(self, fp):
        self.rawdata  = struct.unpack(">5H",fp.read(10))
        namelen, = struct.unpack(">I",fp.read(4))
        cp = fp.read(2*namelen)
        self.name = cp[0:-2].decode('utf-16-be')
        self.typename = self.colorTypeName()

    def colorTypeName(self):
            return {0:"RGB", 1:"HSB",
        except IndexError:
            print self.rawdata[0]

    def __strCMYK(self):
        rgb8bit = map(lambda a: (65535 - a)/655.35, self.rawdata[1:])
        return "{name} ({typename}): {0}% {1}% {2}% {3}%".format(*rgb8bit,**self.__dict__)

    def __strRGB(self):
        rgb8bit = map(lambda a: a/256,self.rawdata[1:4])
        return "{name} ({typename}): #{0:x}{1:x}{2:x}".format(*rgb8bit,**self.__dict__)

    def __strGrayscale(self):
        gray = self.rawdata[1]/100.
        return "{name} ({typename}): {0}%".format(gray,**self.__dict__)

    def __str__(self):
        return {0: self.__strRGB, 1:"HSB",

with open("test.aco", "rb") as acoFile:
    #skip ver 1 file
    head = acoFile.read(2)
    ver, = struct.unpack(">H",head)
    if (ver != 1):
        raise TypeError("Probably not a adobe aco file")
    count = acoFile.read(2)
    cnt, = struct.unpack(">H",count)

    #read ver2 file
    head = acoFile.read(2)
    ver, = struct.unpack(">H",head)
    if (ver != 2):
        raise TypeError("Probably not a adobe aco file")
    count = acoFile.read(2)
    count, = struct.unpack(">H",count)
    for _ in range(count):
        swatch = ColorSwatch(acoFile)
        print str(swatch)

It seems also http://ps-scripts.sourceforge.net/xtools.html has something similar available. I don't know if this exceeds your worldview with a mile or if its suitable so I'm just posting it as is.



1 Launch Photoshop, select the "Window" menu and choose "Swatches." The Swatches panel will open.

2 Click on the small flyout menu in the upper-right corner of the Swatches panel. The flyout menu appears as a downward-facing arrow and a series of horizontal lines. This will open a list of possible actions.

3 Click "Load Swatches" from the list. This will direct you to the folder where Photoshop saves its swatch files.

4 Select the "No_Swatches.aco" file and click "Load." This will clear the existing swatches in the panel so that you can start from scratch.

5 Add as many colors to the Swatches panel as you wish by selecting a color and clicking in the blank space within the Swatches panel. Name the swatch and click "OK." Repeat until all of your chosen colors are represented as swatches.

6 Click on the flyout menu again. It will open the list of possible actions.

7 Click "Save Swatches for Exchange" from the list.

8 Navigate to the location where you want to save your new Swatches file. Name the file and click "Save." This will create an .ASE, or Adobe Swatch Exchange, file which can now be loaded in to many other Adobe programs, including Illustrator and InDesign.

Tips & Warnings While using Swatches is the easiest way to export colors from Photoshop, you can also use values listed in the HSB, RGB, CMYK, LAB, or Hex Color selections to match the correct color in other programs.


Check if this work Give more summary of what exactly you're looking for

  • I added the steps form the linked website. Just in case the link goes dead. – KMSTR Feb 13 '14 at 7:52
  • I need to prepare a design document. ASE is not human-readable. – Anuj Rajput Feb 13 '14 at 7:57

I know this is old, but I was using this script for similar purpose as the OP and found a small error. The script seems to strip out leading '0's in the hex code causing errors like '#26843' instead of '#026843'.

I don't know python, but looking at other examples of RGB to hex conversions with python I figured out how to correct the error and print out a valid Hex color list.

In case anyone else has this same issue, this seems to be the fix:

Old Code:

def __strRGB(self):
    rgb8bit = map(lambda a: a/256,self.rawdata[1:4])
    return "{name} ({typename}): #{0:x}{1:x}{2:x}".format(*rgb8bit,**self.__dict__)

New Code

def __strRGB(self):
    rgb8bit = map(lambda a: a/256,self.rawdata[1:4])
    return "{name} ({typename}): #{0:02x}{1:02x}{2:02x}".format(*rgb8bit,**self.__dict__)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.