-
1. Re: Photoshop psd spec "psfl"
JJMack Jun 18, 2017 4:49 PM (in response to martinb45332993)Searching the web I found this. Do not know it it will be of any use to you Photoshop File Format Decode Library download | SourceForge.net
the search I used: https://www.google.com/search?q=Decode+Adobe+psd+file&oq=Decode+Adobe+psd+file&aqs=chrome. .69i57.23191j0j8&sourceid=chro…
Also the hit may help GitHub - psd-tools/psd-tools: Python package for reading Adobe Photoshop PSD files
-
2. Re: Photoshop psd spec "psfl"
Test Screen Name Jun 19, 2017 2:12 AM (in response to martinb45332993)1 person found this helpful1. You say you've tried integer and float. Did you try fixed point?
2. Don't use that web converter as a reference to compare to (though the value should be similar). Especially if you do not know the RGB working space used in the PSD, but even if you know It, different CMMs will produce different results, and rendering intent may also figure.
-
3. Re: Photoshop psd spec "psfl"
martinb45332993 Jun 19, 2017 2:40 PM (in response to JJMack)Hi and thanks for your pointers.
I took a look at python psd-tools before - they seem to just skip this part.
Then - I took look at libpsd .. they shift-right the resulting uint32 for 8 bits.
// 4 bytes each for XYZ color
data->x_color = psd_stream_get_int(context) >> 8;
data->y_color = psd_stream_get_int(context) >> 8;
data->z_color = psd_stream_get_int(context) >> 8;
However when I do so I'm getting XYZ=(51,91,15) for RGB=(0.0,1.0,0.0).
As "Test Screen Name" mentions the value could be fixed point - so I gave that a try.
There are several options to represent a fixed point number in 32 bits. I've tried an online converter
Fixed Point Converter | Byte Craft Limited - here are the results.
This is the value I'm trying to read out - 100% green.
-> RGB (0.0,1.0,0.0)
With lindbloom's converter (sRGB and D50 white point) I get:
X 0.385065
Y 0.716879
Z 0.097105
The fixed point converter yields these:
format = "fract8"
X 0x00003320 -> 0.3984375
Y 0x00005BC3 -> 0.7109375
Z 0x00000F0F -> 0.1171875
format = "_Fract"
X 0x00003320 -> 0.3994140625
Y 0x00005BC3 -> 0.716888427734375
Z 0x00000F0F -> 0.117645263671875
format = fract24
X 0x00003320 -> 0.3994140625
Y 0x00005BC3 -> 0.716888427734375
Z 0x00000F0F -> 0.117645263671875
Pretty close - I'm not sure if there's some difference in the color space conversion or if it's another fixed point format.
Any ideas why they just didn't put an ordinary float32 there if there is plenty of space!?
I'll continue playing with different fixed point representations and see what I'll get.
Thanks again for your hints (JJMack,Test Screen Name), these were very helpful.