Thanks Aras, you are right, the values are slightly off. I first tried this with a map I created and thought this would be the problem. Then I did a test with color red (255,0,0) in photoshop because I use this color in the same project in another script with a similar procedure and there it works fine. How is it possible that now the values are slightly off, I double checked photoshop and the RGB color code is 255, 0, 0?
Hmm, while writing this I was thinking that in the other texture I actually saved to bmp because the same psd file is used for 2 different textures. So I saved my red square to bmp and now it does return exactly 1,0,0. Not sure if the slightly off values of the psd import are supposed to happen?
Nevermind, it does work fine with psd when not using compression on import.
It should not be any different. But of course if PSD has DXT5 compression and BMP has DXT1 compression (or something like that), then the compression is different.