←Select platform

GaussianCommand Class

Summary
Smooths or blurs an image by applying a Gaussian filter to the specified image.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public class GaussianCommand : RasterCommand 
@interface LTGaussianCommand : LTRasterCommand 
public class GaussianCommand 
    extends RasterCommand 
public ref class GaussianCommand : public RasterCommand   
class GaussianCommand(RasterCommand): 
Remarks
  • Each pixel in the image is blurred based on neighborhood pixels. The radius value determines the size of the neighborhood to consider when blurring a pixel. The result is a blurred version of the original image.
  • The amount of blur is controlled by specifying the size of the neighborhood used for blurring or smoothing. The value of the Radius property determines the size and values of the mask.
  • This command supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
  • This command does not support 32-bit grayscale images.
  • This command supports signed/unsigned data images.

For more information, refer to Removing Noise.

Gaussian Filter Function - Before

Gaussian Filter Function - Before

Gaussian Filter Function - After

Gaussian Filter Function - After

View additional platform support for this Gaussian Filter function.

Example

Run the GaussianCommand on an image and applies the Gaussian filter.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Effects; 
 
 
public void GaussianCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE1.CMP")); 
 
   // Prepare the command 
   GaussianCommand command = new GaussianCommand(); 
   command.Radius = 20; 
   command.Run(image); 
   codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Effects Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.