Table of Contents

Class PsdDetails

Namespace
Egami.Formats.Psd
Assembly
Egami.dll

Details only PSD and PSB have, kept in FormatDetails.

public sealed class PsdDetails : FormatDetails
Inheritance
PsdDetails
Inherited Members

Examples

using Raster image = Raster.Load("photo.psd");
var details = (PsdDetails)image.Metadata.FormatDetails!;
Console.WriteLine($"{(details.Version == 2 ? "PSB" : "PSD")}, {details.ColorMode} at {details.BitsPerChannel} bits, {details.ChannelCount} channels, {details.Compression}");
if (!details.HasRealComposite)
{
    // Saved without Maximize Compatibility: what loaded is Photoshop's placeholder, and a warning says so.
    Console.WriteLine("Save the file again with Maximize Compatibility on.");
}

foreach (PsdResource resource in details.OtherResources)
{
    Console.WriteLine($"Resource {resource.Id}, {resource.Data.Length} bytes");
}

Properties

BitsPerChannel

Gets or sets the bits of each channel: 1, 8, 16 or 32.

public int BitsPerChannel { get; set; }

Property Value

int

ChannelCount

Gets or sets the number of channels stored, color, transparency and extra channels together.

public int ChannelCount { get; set; }

Property Value

int

ColorMode

Gets or sets the color mode. Defaults to Rgb.

public PsdColorMode ColorMode { get; set; }

Property Value

PsdColorMode

ColorModeData

Gets or sets the color mode data: the duotone inks of a duotone file, empty for most files.

public ReadOnlyMemory<byte> ColorModeData { get; set; }

Property Value

ReadOnlyMemory<byte>

Compression

Gets or sets how the flattened image is compressed.

public PsdCompression Compression { get; set; }

Property Value

PsdCompression

ExtraChannels

Gets or sets the names of the channels beyond color and transparency (alpha and spot channels), which are not loaded.

public IList<string> ExtraChannels { get; set; }

Property Value

IList<string>

HasRealComposite

Gets or sets whether the file holds a real flattened image. A file saved without Photoshop's Maximize Compatibility has only a placeholder, which Load returns with a warning; Egami does not composite the layers itself.

public bool HasRealComposite { get; set; }

Property Value

bool

Layers

Gets or sets the layer records, bottom to top as the file lists them.

public IList<PsdLayer> Layers { get; set; }

Property Value

IList<PsdLayer>

OtherResources

Gets the image resources Egami does not map, such as the thumbnail (1036), kept as they were read.

public IList<PsdResource> OtherResources { get; }

Property Value

IList<PsdResource>

Version

Gets or sets the version: 1 for PSD, 2 for PSB.

public int Version { get; set; }

Property Value

int

Methods

Copy()

Returns a deep copy.

public override FormatDetails Copy()

Returns

FormatDetails

The copy.