Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to Read Used Pantone Colors from AI / EPS file?

New Here ,
Jan 07, 2025 Jan 07, 2025

We have a library of several thousand EPS and AI files.  We are trying to create a script that will extract the Pantone colors from the meta data in the file.  Just looking through some examples it seems really inconsistent on where the Pantone values are stored and we're having trouble identifying what is actually used in the image vs an unused color in the Swatches.  

 

E.g., there is no red in the image for this file and it doesn't have a %%DocumentCustomColors tag:
%%CMYKCustomColor: 0.058822598308325 1 0 0 (PANTONE Rhodamine Red CVC) %%CMYKProcessColor: 0.899999976158142 0.479999989271164 0 0 (PANTONE 285 CP)

 

But another file has them all in one place:

%%DocumentCustomColors: (PANTONE 123 CVC)

%%+ (PANTONE 1795 CVC)

%%+ (PANTONE 339 CVC)

%%+ (PANTONE 653 CVC)


For example, some AI files have %%DocumentCustomColors which shows a list of the Pantone color values.  However, other files don't contain that at all and have variably things like "%%CMYKProcessColors" which contains the Pantone values.  Sometimes there are Pantone values listed that are not included in the image but show up in the Swatches and we don't know how to tell the difference.  It sort of feels like we're trying to hit a moving target.

So is there a way for us to extract the list of Pantone colors from an image and ensure that they are actually used in the image?

TOPICS
How-to , Scripting
823
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Explorer ,
Jan 10, 2025 Jan 10, 2025

I don't have a direct solution for you, but I had a question answered on here for a similar project.
Scrape Metadata for Colors 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 10, 2025 Jan 10, 2025

Thanks!  I'll check into that.  There must be a way to identify the colors that are actually used in the image using Bridge or the XMP library.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 27, 2025 Jan 27, 2025
LATEST

There is a tag xmpTPg:PlateNames in the XMP data of a vector file. As far as I have checked several files, it only stores data about the spot colors used in the file, not all of them from the Swatches panel.

 

Check out the script here. It extracts the used spot colors from the XMP data of files in the folder into a txt file
https://community.adobe.com/t5/illustrator-discussions/looking-to-silence-alerts-while-processing-fi...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 10, 2025 Jan 10, 2025

It depends on what program wrote the file, what version wrote it, and what format it is written in, but in general, for illustrator, you should normally see only the used colors in EPS code, but this isn't always the case. (e.g. an errant point or unused text item somewhere).

"DocumentCustomColors" refers to any defined SPOT colours.

"CMYKCustomColors" refers to any swatches that are used, that are NOT spot. (You could also see RGBCustomColor, should that be used) and are listed with the name of the swatch.

Historically, the older original Pantone libraries (CV, CVC, etc) were CMYK-based so you would see listing for them both as a spot reference, but ALSO its CMYK breakdown.

The newer Pantone Libraries are LAB-based, so you would still see two listings, but the CMYK breakdown (or RGB) will be added based on the colour management in your setup at the time.

Now, If, somewehere along the way, has changed a Pantone Spot colour to process, that color will no longer be listed as a DocumentCustomColor and will only be referred to a CMYKCustomColor, but the swatch NAME remains.

Native working files, like AI files, will contain the entire set of swatches, used or not, since Illustrator needs them.

EPS's from other programs may write this all differently, so you are indeed trying to hit a moving target.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2025 Jan 22, 2025

Thanks, Brad.  Sorry for the delay replying.


All images are .EPS or .AI files created by Illustrator.  Do you know if there is a way to identify only the used swatches in an AI file?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 23, 2025 Jan 23, 2025

No, I don't. Not without some work. Of course, if you PLACE each file into, say, an InDesign file, any SPOT colours in that file will be added to ID swatch list. This will not include any used swatch/colour that is not defined as a spot colour. In EPS files, the info was text-based as all postscript code was so it was easy to parse that info out, but >AI files and PDF are compressed and not necessarily readable text, so the code is harder to get at.

As far as Metadata in Bridge, yes, it can show you the plates used in a document, but ONLY if that info was saved in the file originally. This does no good for any legacy files before metadata was a thing.

 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines