Skip to main content
Inspiring
March 16, 2023
Answered

768 byte Color Table

  • March 16, 2023
  • 3 replies
  • 2803 views

Techical question on colour tables

I'm I right in thinking that 768 byte color tables are from legacy versions of Photoshop?

I've tried with various coloured images (6 colours - 256 colours with/without transpaency) to recreate one that's 768 bytes long. But all were 772 bytes. 

The documentation is minimal at best: 

www.adobe.com/devnet-apps/photoshop/fileformatashtml 

 

As always, answers on a piece of toast!

This topic has been closed for replies.
Correct answer jazz-y

No.

When you see a table that is 772 bytes long, the last 2 bytes is number of colors in palette (00 ff), previous 2 bytes is transparency marker (01 00), also 3 bytes before the transparency marker - the color of transparency (ff ff ff ). That is, in fact, the table with the transparency option enabled consists of 255 colors, not 256.

If this checkbox is disabled, the file size will be 768 bytes.

3 replies

jazz-yCorrect answer
Legend
March 16, 2023

No.

When you see a table that is 772 bytes long, the last 2 bytes is number of colors in palette (00 ff), previous 2 bytes is transparency marker (01 00), also 3 bytes before the transparency marker - the color of transparency (ff ff ff ). That is, in fact, the table with the transparency option enabled consists of 255 colors, not 256.

If this checkbox is disabled, the file size will be 768 bytes.

Inspiring
March 16, 2023

I'm still getting 772 bytes regardless of transparency

Legend
March 16, 2023

Are you using a previously saved file that has been converted to indexed colors? This option may have been set before (the transparency marker will be in the table even if the file does not have transparent pixels). Try converting it to RGB and convert to indexed colors again.

 

I don't fully understand what you are trying to do, but if you want to read *.acl file, just make sure its size is a multiple of 3 bytes. Or sequentially read three bytes and each time make sure that the rest of the file is not equal to 4 (this will be a sign of the presence of a transparency marker)

Legend
March 16, 2023

I don't know how you're creating it, but 256 x 3 + 768. If you put the raw RGB data from 256 samples (each 3 bytes), it can't be any other size. Transparency not relevant. 

Semaphoric
Community Expert
Community Expert
March 16, 2023

Color tables are for images in Indexed Color mode, which have a maximum of 256 colors. It's a relic, but still has uses.

Inspiring
March 16, 2023

I'm a relic, but I still have my uses.