Enum PsdLayerType
What a layer holds, from the blocks its record carries.
public enum PsdLayerType
Fields
Adjustment = 5An adjustment layer, such as levels or curves, which changes the layers under it and has no pixels.
Fill = 4A solid color, gradient or pattern fill.
Group = 6A group record: one end of a group, see Kind.
Pixel = 0Pixels painted in Photoshop.
Shape = 2A shape: a fill bounded by a vector mask; its pixels are Photoshop's rendering of it.
SmartObject = 3A smart object; its pixels are Photoshop's rendering of the embedded or linked file.
Text = 1Text; 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")})");
}