PostResource.Levels

PostResource.Levels property

Levels of Posterize layer.

public short Levels { get; set; }

Return Value

Levels int value

Examples

The following code demonstrates the ability to manipulation of PostResource.

[C#]

string sourceFile = "zendeya_posterize.psd";
string outputFile = "zendeya_posterize_10.psd";

using (var image = (PsdImage)Image.Load(sourceFile, new PsdLoadOptions()))
{
    Layer layer = image.Layers[1];

    foreach (LayerResource resource in layer.Resources)
    {
        if (resource is PostResource)
        {
            ((PostResource)resource).Levels = 10;
            image.Save(outputFile);

            break;
        }
    }
}

See Also