Skip to content
Member Filters
Show Inherited
Show Protected
Show abstract
GR32.Blur🞂Blur32Routine

Blur32

Blurs a 32-bit bitmap using a fast recursive Gaussian filter.

Declarations ​

pascal
procedure Blur32(ASource, ADest: TBitmap32; Radius: TFloat); overload;
procedure Blur32(Bitmap: TBitmap32; Radius: TFloat); overload;
procedure Blur32(Bitmap: TBitmap32; Radius: TFloat; const Bounds: TRect); overload;
procedure Blur32(Bitmap: TBitmap32; Radius: TFloat; const Region: TArrayOfFloatPoint); overload;
Overload Details

Overload 1 ​

pascal
procedure Blur32(ASource, ADest: TBitmap32; Radius: TFloat); overload;

Blurs the source bitmap and writes the result into the destination bitmap.

ParameterTypeDescription
ASourceTBitmap32Source 32-bit bitmap to read pixels from.
ADestTBitmap32Destination 32-bit bitmap to receive the blurred output.
RadiusTFloatBlur radius in pixels.

Overload 2 ​

pascal
procedure Blur32(Bitmap: TBitmap32; Radius: TFloat); overload;

Blurs the entire bitmap in-place.

ParameterTypeDescription
BitmapTBitmap32Bitmap to blur in-place.
RadiusTFloatBlur radius in pixels.

Overload 3 ​

pascal
procedure Blur32(Bitmap: TBitmap32; Radius: TFloat; const Bounds: TRect); overload;

Blurs a rectangular sub-region of a bitmap in-place.

ParameterTypeDescription
BitmapTBitmap32Bitmap containing the sub-region to blur.
RadiusTFloatBlur radius in pixels.
BoundsTRectBounding rectangle defining the target sub-region.

Overload 4 ​

pascal
procedure Blur32(Bitmap: TBitmap32; Radius: TFloat; const Region: TArrayOfFloatPoint); overload;

Blurs an arbitrary polygonal region of a bitmap in-place.

ParameterTypeDescription
BitmapTBitmap32Bitmap containing the polygonal region to blur.
RadiusTFloatBlur radius in pixels.
RegionTArrayOfFloatPointArray of 2D floating-point points defining the polygon vertices.

Description ​

Blur32 performs spatial Gaussian blurring on 32-bit ARGB bitmaps using a high-performance Infinite Impulse Response (IIR) recursive Gaussian filter.

The filter execution time is O(1) per pixel, making performance independent of the specified Radius.

Radius Threshold ​

If Radius is less than Blur32MinRadius (default 0.5 pixels), Blur32 skips filter calculations. For out-of-place calls (ASource, ADest), ASource is copied directly to ADest. For in-place calls, the procedure exits immediately.

Channel Processing ​

All four color channels (Red, Green, Blue, Alpha) are processed. Blurring the Alpha channel produces smooth antialiased region borders and drop shadows.

Example ​

pascal
var
  Bmp: TBitmap32;
begin
  Bmp := TBitmap32.Create;
  try
    Bmp.LoadFromFile('input.png');

    // Blur entire bitmap in-place with a 5.0 pixel Gaussian radius
    Blur32(Bmp, 5.0);

    Bmp.SaveToFile('blurred.png');
  finally
    Bmp.Free;
  end;
end;

See also ​