Table of Contents

Enum PsdLayerType

Namespace
Egami.Formats.Psd
Assembly
Egami.dll

What a layer holds, from the blocks its record carries.

public enum PsdLayerType

Fields

Adjustment = 5

An adjustment layer, such as levels or curves, which changes the layers under it and has no pixels.

Fill = 4

A solid color, gradient or pattern fill.

Group = 6

A group record: one end of a group, see Kind.

Pixel = 0

Pixels painted in Photoshop.

Shape = 2

A shape: a fill bounded by a vector mask; its pixels are Photoshop's rendering of it.

SmartObject = 3

A smart object; its pixels are Photoshop's rendering of the embedded or linked file.

Text = 1

Text; its pixels are Photoshop's rendering of it.

Examples

// Layer records come as metadata, bottom to top as the file lists them; their pixels are not loaded.
using Raster image = Raster.Load("layered.psd");
foreach (PsdLayer layer in ((PsdDetails)image.Metadata.FormatDetails!).Layers)
{
    if (layer.Kind == PsdLayerKind.GroupEnd)
    {
        continue;
    }

    string kind = layer.Kind == PsdLayerKind.Layer ? "layer" : "group";
    Console.WriteLine($"{new string(' ', 2 * layer.Level)}{layer.Name} ({kind}, {layer.BlendModeKey}, opacity {layer.Opacity:P0}{(layer.IsVisible ? "" : ", hidden")})");
}