Work with Smart Filters and Smart Objects in PSD File with C#

Smart Filters Smart Objects PSD csharp

Smart filters are used to enable the non-destructive editing of an image. They are re-editable as they retain the filter settings and can be adjusted or removed from the image if needed. Moreover, you can add one or more smart filters provided a layer is a smart object. This article covers how to edit and update smart filters as well as add new filters like GaussianBlurSmartFilter, AddNoiseSmartFilter, etc. to an image programmatically in C#.

Work with Smart Filters and Smart Objects in PSD File – C# API Installation

You need to install Aspose.PSD for .NET API to work with PSD images programmatically in C# .NET. Quickly download its DLL file from the Downloads section or use the NuGet installation command in the Visual Studio IDE:

PM> Install-Package Aspose.PSD

Add, Edit and Update Smart Filters and Smart Objects in C#

You can edit, update, or add new smart filters to the smart objects in a PSD file by following the steps below:

  • Load the input PSD image using the Image class.
  • Load the smart object layer from the input file.
  • Edit the smart filter and check its properties like radius, blend mode, opacity, etc.
  • Update filter properties and add new smart filters like Gaussian blur, Add Noise, etc.
  • Save the output file with updated filters and check updated properties.

The code snippet below shows how to edit, update, or add smart filters on smart objects in a PSD image programmatically in C#:

The screenshot below shows the sample output produced on the console after executing the above code snippet:

Moreover, you may download the input and output files from this link for reference.

Explore API Features

There are many other classes and properties to work with the PSD and other images. You can visit the documentation section for more information.

Get a Free Evaluation License

You can evaluate the API without any evaluation limitations by requesting a free temporary license.

Conclusion

In this article, you have learned how to work with Smart Filters on Smart Objects in a PSD image programmatically in C#. It discusses how to edit and update existing smart filters in an image, as well as add new smart filters like GaussianBlurSmartFilter, AddNoiseSmartFilter, etc. to an image. Furthermore, it is noteworthy here that you do not need to install any Photoshop, or any other image processing application to work with this feature because the API is not dependent on any other tool. In case you have any queries or concerns, please write to us at the forum.

See Also

Add Signature to an Image Programmatically in C#