2003.05.12 18:38 "Re: Photoshop layers, Lab colorspace", by Chris Cox
I'm new on the TIFF list. I don't know if any FAQs exist, and am just hoping that I don't bore anyone with my questions. I have written a graphics application for the BeOS, which is not yet published. TIFF would support saving any information I would like to remember in my image files. However, the main reason I'm interested in TIFF is that Photoshop can now save layer information in TIFF files. Unfortunately, I have not figured out, how it does that. My first guess, after reading a bit through the libtiff documentation, is that it maybe uses multiple TIFF directories, one for each layer. This seems not the case though. Is there any information available on how Photoshop saves layers in TIFF files?
Yes, in the Photoshop SDK.
My second question is about the Lab colorspace. I have read much about it, but am having difficulties implementing the correct conversion routines for RGB to Lab and back. I have used the matrix constants and algorithms described in the Color Space Conversions by Adrian Ford and Alan Roberts, however, converting some RGB color to Lab and back again produces some slightly more red result. And my routines are slow. Reading about in the TIFF spec, I was surprised to find some paragraphs on Lab, and this got my curious again, since it says that conversion can be fast using LUTs. Can someone point me to some resources that would be helpful? Or even provide code?
Use LUTs for the power function conversion. The rest is simple matrix math.