GaussianBlur

procedure GaussianBlur(img: TImage32; rec: TRect; radius: Integer);

Note: BoxBlur is generally recommended over GaussianBlur since BoxBlur can closely approximate GaussianBlur and is usually much faster.

  uses Image32, Image32_Extra, Image32_PNG;
  ...
  img := TImage32.Create;
  img.LoadFromFile('lenna.png');
  GaussianBlur(img, img.Bounds, 10);
  img.SaveToFile('lenna_gauss.png');
  img.Free;
      

  uses Image32, Image32_Extra, Image32_PNG;
  ...
  var
    img: TImage32;
    rec: TRect;
    pt: TPoint;
  begin
    img := TImage32.Create(256, 256);

    rec := Rect(img.Width - 120, 0, img.Width, 120);
    pt := MidPoint(rec);
    DrawPoint(img, PointD(pt), 20, clNavy32);
    GaussianBlur(img, rec, 48);

    Windows.OffsetRect(rec, -120, 0);
    pt := MidPoint(rec);
    DrawPoint(img, PointD(pt), 20, clNavy32);
    GaussianBlur(img, rec, 24);

    rec := Rect(img.Width - 120, img.Height -125, 
      img.Width, img.Height-5);
    pt := MidPoint(rec);
    DrawPoint(img, PointD(pt), 20, clNavy32);
    BoxBlur(img, rec, 12, 3);

    Windows.OffsetRect(rec, -120, 0);
    pt := MidPoint(rec);
    DrawPoint(img, PointD(pt), 20, clNavy32);
    BoxBlur(img, rec, 6, 3);

    img.Free;
      

See Also

BoxBlur