---
title: "Check PSD Features"
canonical: https://www.graphicsmill.com/samples/PSDFormat/ValidatePSD/CheckPsdFeatures_cs
product: "Graphics Mill"
source: "PSDFormat/ValidatePSD/CheckPsdFeatures.cs"
---

# Check PSD Features

Checks that PSD files contain only features from a predefined list.

## Instruction

Write a C# program that validates multiple PSD files ("Mug.psd", "UnsupportedFeatures.psd") using PsdReader.CheckFeatures method against a predefined whitelist of supported features including raster layers, smart objects, normal blend mode, RGB color mode, and 8-bit channels, outputting validation status to console for each file to determine render compatibility.

## Usings

```csharp
using System;
using Aurigma.GraphicsMill.Codecs.Psd;
```

## Code Snippet

```csharp
var filenames = new string[]
{
    "Mug.psd",
    "UnsupportedFeatures.psd",
};

// A list of features that can be correctly handled by a renderer
var renderSupportedFeatures = new PsdFeature[]
{
    PsdFeature.LayerTypeRaster,
    PsdFeature.LayerTypeSmartObject,
    PsdFeature.BlendModeNormal,
    PsdFeature.ColorModeRgb,
    PsdFeature.ChannelSize8bit,
};

foreach (var filename in filenames)
{
    using (var psdReader = new PsdReader(filename))
    {
        if (psdReader.CheckFeatures(renderSupportedFeatures))
        {
            Console.WriteLine("File {0} is valid", filename);
        }
        else
        {
            Console.WriteLine("File {0} is not valid", filename);
        }
    }
}
```

## Explanation

Below is a C# code sample that validates PSD feature compatibility for rendering:

The code demonstrates PSD feature validation using PsdReader.CheckFeatures with explicit whitelist of supported capabilities (LayerTypeRaster, LayerTypeSmartObject, BlendModeNormal, ColorModeRgb, ChannelSize8bit), enabling pre-processing quality assurance to identify PSD files compatible with specific rendering pipelines. The validation prevents runtime errors from unsupported features like advanced blend modes, 16-bit channels, CMYK color space, or complex layer types, supporting automated workflows where only validated PSD templates proceed to rendering, ensuring consistent output quality and preventing processing failures in batch production environments.

## Tags

- [Image Validation](<https://www.graphicsmill.com/samples/tags/validation_md>): Inspecting images for unsupported or problematic features
- [PSD](<https://www.graphicsmill.com/samples/tags/psd_md>): Importing layered PSD files

## Input

- [Mug.psd](<https://www.graphicsmill.com/samples/PSDFormat/compiled/Debug/Mug_psd>) (download)
- [UnsupportedFeatures.psd](<https://www.graphicsmill.com/samples/PSDFormat/compiled/Debug/UnsupportedFeatures_psd>) (download)

## Output

- [CheckPsdFeatures.txt](<https://www.graphicsmill.com/samples/PSDFormat/compiled/Debug/CheckPsdFeatures_txt>) (preview)

## Used APIs

- [Aurigma.GraphicsMill.Codecs.Psd.PsdFeature](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_Psd_PsdFeature.htm.md>)
- [Aurigma.GraphicsMill.Codecs.Psd.PsdReader](<https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_Psd_PsdReader.htm.md>)
- [Aurigma.GraphicsMill.Codecs.Psd.PsdReader.CheckFeatures(IEnumerable\{PsdFeature\})](<https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Codecs_Psd_PsdReader_CheckFeatures_1_d0b98aff.htm.md>)
