Reading PSD file format

The ImageMagick libraries (which provide bindings for C#) also support the PSD format. They might be easier to get started with than getting into the Paint.NET code and also come with a quite free (BSD-like) license.

A simple sample (found at http://midimick.com/magicknet/magickDoc.html) using MagickNet would look like this:

using System;

static void Main(string[] args)
{
    MagickNet.Magick.Init();
    MagicNet.Image img = new MagicNet.Image("file.psd");
    img.Resize(System.Drawing.Size(100,100));
    img.Write("newFile.png");
    MagickNet.Magick.Term();
}

Note: MagickNet has moved to http://www.codeproject.com/KB/dotnet/ImageMagick_in_VBNET.aspx


This guy do it easier:

http://www.codeproject.com/KB/graphics/simplepsd.aspx

With a C# library and a sample project.

I've tried with PS2 files and works ok.


Well, there's a PSD plugin for Paint.NET which I think is Open-Source which you might want to take a look at for starters:

http://frankblumenberg.de/doku/doku.php?id=paintnet:psdplugin#download


I have written a PSD parser which extracts raster format layers from all versions of PSD and PSB. http://www.telegraphics.com.au/svn/psdparse/trunk