Hello,
I'm trying to open a psd file, but the transparency information is always lost.
Is this the "normal" behavior or am I doing something wrong?
Thank you
Could you post some non working image here please?
PSD loader only reads raster data, no layers, objects, etc.
Transparency stored in alpha channel works ok (tested with CS2).
I was trying to open the following image: http://rapidshare.com/files/70858462/test.psd.html (http://rapidshare.com/files/70858462/test.psd.html)
In Photoshop it shows a transparent background. But when I open it it has a completely white background.
image := TSingleImage.Create;
image.Format := ifA8R8G8B8;
image.LoadFromFile('test.psd');
p := Image.ScanLine[j]; // p: PRGBQuad;
p.rgbReserved is always 255. When i see that in Photoshop it has transparency information I would expect to be able to get it programatically.
Is there a way to get the transparency, or I must live with the white background :) ?
Thank you.
Could you please upload it as attachment on the forum? I have problems
downloading it from rapidshare.
Sorry about that. I've attached the file.
As I wrote before Imaging's PSD loader doesn't read layer information which is how transparency is stored in your image. You need to get your transparency into alpha channel (and set image mode from CMYK to RGB as Imaging currently doesn't read alpha channel of CMYK images).
How I made attached Imaging compatible transparent PSD from your image:
1. 'Merge Visible' the two image layers
2. 'Select Layer Transparency' on merged layer
3. Set 'Image->Mode' to RGB
4. 'Save selection as channel' which created alpha channel with proper transparency
5. Finally save the file
Complicated, but at least both PSD layers and native CMYK data formats will be supported in
upcoming Imaging 0.3x.