Gaussian Blur Filter SVG C#

SVG or Scalable Vector Graphic images are popular due to their scalability and quality features. You can apply several filters on SVG images based on your requirements. to blur and smooth an SVG image, you may apply a Gaussian blur filter. Following such use cases, this article discusses how to create a Gaussian blur filter on an SVG image programmatically in C#.

Apply Gaussian Blur Filter on an Image – C# API Installation

Aspose.SVG for .NET can be used to create or edit Scalable Vector Graphic files programmatically in C#. You can quickly download the DLL files from the Downloads section, or use the following NuGet installation command in Microsoft Visual Studio IDE:

PM> Install-Package Aspose.SVG

How to Create Gaussian Blur Filter on SVG Image in C#

You can create a Gaussian blur filter on an SVG image by following the steps below:

  1. Initialize an SVGDocument class object and set SVG namespace URL.
  2. Create an image element and a filter element.
  3. Append the graphic element.
  4. Create a feGaussianBlur element and add it to the filterElement.
  5. Save the output SVG image.

Create Gaussian Blur Filter on SVG Image Programmatically in C#

The following steps can be used to create a Gaussian blur filter on an SVG image programmatically in C#:

  1. Create an SVGDocument instance and load the source SVG file.
  2. Specify the namespace URL for SVG and access the root element.
  3. Create a filter element and feGaussianBlur element.
  4. Export the output SVG file with the Save method.

The following code sample demonstrates how to create a Gaussian blur filter on an SVG image in C#:

Get a Free API License

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

Conclusion

In this article, you have investigated and explored how to create a Gaussian blur filter effect on an SVG image programmatically in C#. Whereas, you can take a look at the documentation space to check various features offered by the API. Please feel free to write to us at the forum in case you need to discuss any of your concerns.

See Also