Try to read PSD file according to specifications: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
Due to time constrains now it reads only a single layer.
It was painful to parse image data take a look to: Macintosh ROM routine PackBits