Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Note: the PSD text format is implemented in https://github.com/layervault/psd-enginedata/tree/master/lib/psd/enginedata