PsdPackage

PsdRootPackage.PsdPackage property

Gets the metadata package containing information about the PSD file.

public PsdPackage PsdPackage { get; }

Property Value

The metadata package containing information about the PSD file.

Remarks

Learn more

Examples

This code sample demonstrates how to read the header of a PSD file and extract some information about the PSD layers.

using (Metadata metadata = new Metadata(Constants.PsdWithIptc))
{
    var root = metadata.GetRootPackage<PsdRootPackage>();

    Console.WriteLine(root.PsdPackage.ChannelCount);
    Console.WriteLine(root.PsdPackage.ColorMode);
    Console.WriteLine(root.PsdPackage.Compression);
    Console.WriteLine(root.PsdPackage.PhotoshopVersion);

    foreach (var layer in root.PsdPackage.Layers)
    {
        Console.WriteLine(layer.Name);
        Console.WriteLine(layer.BitsPerPixel);
        Console.WriteLine(layer.ChannelCount);
        Console.WriteLine(layer.Flags);
        Console.WriteLine(layer.Height);
        Console.WriteLine(layer.Width);

        // ...
    }

    // ...
}

See Also