Skip to main content
Participant
April 21, 2008
Question

Creating .ACB (Color Book) file from .ACO (swatches) file

  • April 21, 2008
  • 4 replies
  • 20970 views
Is there a way to convert a .aco file to a .acb file? I really need my colors to be visible in the Color Libraries section of Photoshop to use with Color Layers.

The .acb files are the files located in \Program Files\Adobe\Adobe Photoshop CS2\Presets\Color Books.

Please let me know if anyone knows how to do that, it would be really helpful!
This topic has been closed for replies.

4 replies

Inspiring
July 8, 2024

i was able to do this for >3000 colors relatively easily. you can source the color book info from many places. if you were doing pantone or something like that you could query all potential combinations of this URL https://www.pantone.com/media/wysiwyg/color-finder/img/pantone-color-chip-101-c.webp and filter responses to only show images that respond with X-Cache: HIT, HIT (not X-Cache: MISS, MISS), writing the successful links to a .csv file, wget the image links in csv to a directory, then run imagemagick against that directory to create a 3-5 depth histogram of the webp images, sort histogram by most occuring and use regex to get the individual RGB values for the most occuring color which you could then use to build your own color book later on, or just store the hex value, or whatever value you want. example of unfiltered imagemagick histogram response: 

 

          6442: (25,25,25) #191919 srgb(25,25,25)
          1832: (184,183,164) #B8B7A4 srgb(184,183,164)
         88526: (254,254,254) #FEFEFE srgb(254,254,254)
        193600: (255,215,1) #FFD701 srgb(255,215,1)

 


Building a color book: 
Download and unzip this. 
https://github.com/atesgoral/acb

In the main directory, create a json file with your specs, save it as data.json with RGB, CMYK or Lab values as numbers (below example is in RGB so RGB values are used, separated by comma separated lines in the "components" section): 

 

{
   "id":3057,
   "title":"TitleOfYourBook",
   "colorNamePrefix":"",
   "colorNamePostfix":"",
   "description":"Description not visible or used anywhere practical",
   "pageSize":7,
   "pageKey":4,
   "colorModel":"RGB",
   "colors":[
      {
         "name":"Spot Color Name 1",
         "code":"000001",
		 "spotProcessIdentifier":"spflspot",
         "components":[
            50,
            46,
            32
         ]
      },
      {
         "name":"Spot Color Name 2",
         "code":"000002",
         "components":[
            33,
            39,
            32
         ]
      }
   ]
}

 

 
edit encode-acb.js to: 

 

const fs = require('fs');
const { encodeAcb } = require('@atesgoral/acb');

// Specify the path to your JSON file containing the ACB data
const jsonFilePath = 'data.json'; // Update with your file path

// Read the JSON file
fs.readFile(jsonFilePath, 'utf8', (err, data) => {
    if (err) {
        console.error('Error reading JSON file:', err);
        return;
    }

    try {
        const acbData = JSON.parse(data);

        // Encode ACB data
        const acbBuffer = Buffer.concat([...encodeAcb(acbData)]);

        // Write the ACB buffer to a file
        fs.writeFileSync('TitleOfYourBook.acb', acbBuffer);

        console.log('ACB file generated successfully: mybook.acb');
    } catch (error) {
        console.error('Error parsing JSON or encoding to ACB:', error);
    }
});

 

 make sure node.js is installed. start a powershell or command in that directory and type node encode-acb.js. your colorbook should now be in the directory. 

To change all colors to spot colors, open your .acb file in a binary hex editor https://hexed.it/ and edit the last 8 bits (scroll all the way down and replace letters on right side) from spflproc to spflspot. you now have a spot color library. 

EDIT: you have to use Lab colors from the gitgo to make an accurate spot color library. you cant just write spflspot at the end of the acb hex file. 

schroef
Inspiring
July 9, 2024

I doubt your numbers for CMYK are as the official ones. The real CMYK values differ from a color chip and then simply made CMYK. Appreciatie the work though 

Inspiring
July 9, 2024

(Edit 2 for readers: Lab colors are used in acb files as Lab is a good intermediary between RGB/CMYK. Starting with Lab is the safest option, the next safest option when converting RGB to CMYK or vice versa is first converting to Lab and then converting to the desired color. if converting to cielab via spreadsheet you would have about 25 columns: RGB, normalized RGB, green val, magenta val, blue val, yellow val, gamma corrected RGB, XYZ defined, normalized XYZ, trans XYZ, final result of Lab values)

Thanks for reading. Correct, the CMYK and RGB will slightly vary but will suffice for digital preview since RGB is being pulled. Official pantone acb files use Lab values and no other values are stored- RGB and CMYK is left up to your graphics program to interpret which 99.9% of the time has a doc color mode of RGB or CMYK, so the Lab values aren't even being utilized 99% of the time.

That being said, if printing with color conversion on a printer that already has the pantone library, the CMYK/RGB/Lab values are all trashed at time of printing and that printers' own color library management is used to define ink output based solely on the spot color ID, all other info is ignored. You could have a spot color like "PANTONE Yellow 021 C" physically colored CMYK 0 0 0 0 (white) in the document and if the printer uses color conversion it would set it's own CMYK output based on it's calibration like 0 1 98 1. Printing without color conversion leaves CMYK up to chance as CMYK 10 20 10 5 will look vastly different from printer to printer. Most printers nowadays also use RGB instead of CMYK, if color conversion is not set, as RGB has a wider spectrum of colors, that's why I chose to pull RGB. Also some printers run dual CMYK and some even run a lighter version like Cyan-lightcyan-magenta-lightmagenta-yellow-lightyellow. 

To get accurate cmyk or Lab values, the most recent data is likely hosted on a 3rd party site and would require an additional step after code validation and before building the color book, like querying this URL https://icolorpalette.com/color/pantone-VALUE-c and scraping lab values from selector #content > div > div.col-sm-12.py-4.col-md-6 > div:nth-child(5), and route output to your CSV prior to creating the .json file from CSV. not sure if those values are accurate but that's how you'd do it. 

EDIT: you have to use Lab colors from the gitgo to make an accurate spot color library. you cant just write spflspot at the end of the acb hex file. 

Participant
March 17, 2011

Hi Julien,

Can you give me some Idea about creating the color books from scratch.

Inspiring
March 17, 2011

I have this code that reads Color Book files:

http://ps-scripts.cvs.sourceforge.net/viewvc/ps-scripts/xtools/xlib/ColorBook.js

You will also need this file to do the binary I/O.

http://ps-scripts.cvs.sourceforge.net/viewvc/ps-scripts/xtools/xlib/Stream.js

There are several 'magic' fields in ColorBook (like Vendor ID and Vendor Name) that

you will have to figure out how to create new values that PS likes. Using

swatch files is much easier and code is on the sourceforge site for reading

and writing those.

Chris Cox
Legend
March 18, 2011

For the most part, you should not be creating color book files.   Those are for folks like Pantone, Toyo, DIC, etc. who publish real swatch books.

Most users should only be creating .ACO or .ASE files for their color swatches.

Participant
July 9, 2008
I finally found out how to do it myself. So if anyone needs to have one made, you can contact me instead of contacting Ates Goral ;)

julien.grimard@gmail.com
Known Participant
July 9, 2008
Julien_Grimard@adobeforums.com wrote:
> I finally found out how to do it myself. So if anyone needs to have one made, you can contact me instead of contacting Ates Goral ;)
>
> julien.grimard@gmail.com

I also have a couple of library scripts in xtools that may help. One can read
ColorBook files, the other can read and write ColorSwatches files. Fitting the
two together shouldn't be too much of a challenge.

-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com
Participant
May 8, 2008
Ates Goral (ates@magnetiq.com) has made a couple of color books
from custom color files that I have given him. He charges a reasonable price.