Last active
January 6, 2024 13:13
Blur Image in C#. For more details: https://kb.aspose.com/imaging/net/blur-image-in-csharp/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Aspose.Imaging; | |
using System; | |
class Program | |
{ | |
static void Main(string[] args) // Blur image in C# | |
{ | |
new License().SetLicense("License.lic"); | |
// Load the image | |
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load("input.png")) | |
{ | |
// Convert the image into RasterImage | |
Aspose.Imaging.RasterImage rasterImage = (Aspose.Imaging.RasterImage)image; | |
// Apply blur effect | |
rasterImage.Filter(rasterImage.Bounds, new Aspose.Imaging.ImageFilters.FilterOptions.GaussianBlurFilterOptions(5, 5)); | |
// Save blurred image | |
rasterImage.Save("output.png"); | |
} | |
Console.WriteLine("Image Blurred successfully"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment