Table of Contents

Enum PsdColorMode

Namespace
Egami.Formats.Psd
Assembly
Egami.dll

A PSD color mode, by its code in the file header.

public enum PsdColorMode

Fields

Bitmap = 0

1-bit black and white (0), loaded as Gray8.

Cmyk = 4

Cyan, magenta, yellow, black (4).

Duotone = 8

Gray printed with up to four inks (8); loaded as gray, the inks kept in ColorModeData.

Grayscale = 1

Gray (1).

Indexed = 2

Indices into a 256-color table (2), loaded as RGB.

Lab = 9

CIE Lab* (9), converted to sRGB on load.

Multichannel = 7

Several inks with no fixed meaning (7); the first is loaded as gray.

Rgb = 3

Red, green, blue (3).

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