Can I access and save the Color Table in an INDEXEDCOLOR document?

I’m working with documents that are mode = DocumentMode.INDEXEDCOLOR. In Photoshop, I can go to Image > Mode > Color Table... and see swatches of every color; then I can save the color table as an .act file. I would like to do this using UXP’s app.activeDocument. Is this possible?

There is currently no DOM support for saving indexed color table. And it seems that even batch play won’t help.

A late response, but I’m running into the same problem. I have not figured out a way to update previous palette so it uses the palette I want. However, if you can save the image as png or some other file type, you can read the palette from that image. PCX is really easy because the palette is the last 768 bytes of the file in RGB format. Just save and use fs to get the data. You can also save an act using fs by creating a buffer that is 772 bytes in length (2563+4). The first 2563 are RGB colors. The next four bytes are used (1,0) and transparency (1,1). That transparency value seems to work and it sets it to use color at index 256 as transparency which doesn’t exist.

1 Like