Enum PsdCompression
How the flattened image's channels are compressed, by the code before them.
public enum PsdCompression
Fields
Deflate = 2Deflate (2).
DeflatePredicted = 3Deflate of each row's differences from its left neighbor (3).
PackBits = 1PackBits rows, each row's byte count listed first (1). What Photoshop writes.
Raw = 0Uncompressed 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");
}