Table of Contents

Enum PsdCompression

Namespace
Egami.Formats.Psd
Assembly
Egami.dll

How the flattened image's channels are compressed, by the code before them.

public enum PsdCompression

Fields

Deflate = 2

Deflate (2).

DeflatePredicted = 3

Deflate of each row's differences from its left neighbor (3).

PackBits = 1

PackBits rows, each row's byte count listed first (1). What Photoshop writes.

Raw = 0

Uncompressed rows (0).

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");
}