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

Custom indexed colors from a script

Community Beginner ,
Nov 22, 2020 Nov 22, 2020

Wondering if anyone has advise on converting a logo bitmap file to indexed colors (RGB) that have been extracted beforehand in an image analyzer. I'm looking to use a script to convert it to specific colors but am having trouble understanding what the color table uses to order the colors. I've tried hue, popularity luminance and they all give me inconsistent image results. Any idea what the method to ordering the colors?

33F030F9-A7F0-4006-B98B-B46A6D371675.jpegexpand image

 

3E64D30D-B0D7-4278-ABE3-5E184F616A71.jpegexpand image

 

TOPICS
Actions and scripting
652
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
Community Expert ,
Nov 24, 2020 Nov 24, 2020

I would imagine that the most common method is to reduce the existing colours in the image using the built-in indexed colour algorithms in Photoshop (perceptual, selective, adaptive etc). There is another option, which is to use a pre-defined "Adobe Color Table" or .ACT file.

 

Knowing this, a Google search kicked up many hits, here are just a few:

 

https://graphicdesign.stackexchange.com/questions/90809/export-adobe-photoshop-color-table-act-file-...

https://community.adobe.com/t5/photoshop/how-do-i-export-the-color-table-act-file-using-a-script/td-...

https://www.lifewire.com/act-file-2619481

https://github.com/zenozeng/act.js/

 

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
Engaged ,
Dec 01, 2020 Dec 01, 2020
LATEST

This isn't so straight-forward in Photoshop scripting, but the format is simple enough. 

The file fomat can be found here.  Each colour is started as a hexdecimal colour with zeroes as padding ending up with the number of colours and transparancy index.

png_hex.jpgexpand image

As you see from the image of a text file (Sublime Text) editor the first (highlighted) colour is #000000. Followed by #204020, #202020, #ff00ff etc

There doesn't seem to be any rhyme or reason to the ordering of the colours. Sometimes it's light to dark, other apparerntly random.

 

a good start the the second link Stephen mentioned, as that basically writes out the act file from the PSD (the long way round - you'll find out) But that's enough to get you started.

 

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