Get the current Photoshop SDK and read the documentation for the PSD format.
The channel type and other information is in an image resource block, but hasn't really changed in many years.
It's that documentation the one that I'm reading. As I said before, I've been able to find within the resource block the other channel information, but I can't find the type.
The current SDK is much newer than 1997.
Again, you should get the current SDK for CS5 or CS6.
There is a specific resource for channel information, that describes the channel type and options.
Can you be a bit more specific, Chris?
Unless I'm being a real bonehead today and missing something obvious, the Photoshop CS6 SDK carries no documentation on the PSD format nor an image resource block. I found a few references to same in PIUtiliites.h, that's all.
On the other hand, Google turns this up in an eyeblink: http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
The PSD documentation should be in the SDK now, we put it back in CS5 after having it as a separate download for years.
And yes, that HTML version appears to be the CS5 documentation.
Please double check. I think you may have remembered it backwards.
I searched the SDKs thoroughly. There is no description of the PSD format or an "image resource block" in the Photoshop CS5 or CS6 SDKs.
There IS however, some information in the CS3 and CS4 SDKs (I didn't look back farther than that). Example: documentation\html\imageresourcessection.html
This information was stored in resource block 1007 (0x03ef) - its structure matched DisplayInfo described in Appendix A (Photoshop API Guide). This resource block is no longer written by CS6 and block 1077 is used instead. Block 1077 is using different internal format than 1007 - where could be description of new format found?
I have the same issue.
The description of the new format can be found in "Photoshop API Guide.pdf" which is part of the Photoshop SDK.
int16 opacity; // 0..100
char kind; // selected = 0, protected = 1
char padding; // should be zero
Sadly the information about alpha or spot channel is not in there.
Since Photoshop can still determine the extra channel type, this information must be stored someplace else.
There has to be somebody at Adobe, who can give us this information.
I was wrong about the information not being in image resource block 1077.
It's just not documented (in the documents I looked at), how to read it correctly.
With a lot of help from others I figured it out.
The data is almost the same as in block 1007, but not exactly.
The differences are:
1) Additional 4 bytes a the beginning, that contain the version number (which seems to be 1).
2) The array of DisplayInfo structures looses the 1 byte padding at the end of every structure. (so now it's 13 bytes per structure instead of 14)
int16 opacity; // 0..100
char mode; // alpha = 0, inverted alpha = 1, spot =2
So the alpha information is in the last byte of the DisplayInfo structures.