<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSImageGaussianBlur/init(device:sigma:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSImageGaussianBlur(im)initWithDevice:sigma:"
  },
  "title" : "init(device:sigma:)"
}
-->

# init(device:sigma:)

Initializes a Gaussian blur filter.

```
init(device: any MTLDevice, sigma: Float)
```

## Parameters

`device`

The Metal device the filter will run on.

`sigma`

The standard deviation of the gaussian blur filter.

    Gaussian weight     `w`    , centered at     `0`    , at integer grid     `i`    , is given as:

    `w(i) = 1/sqrt(2*pi*sigma) * exp(-i^2/2*sigma^2)`

    If we take cut off at 1% of     `w(0)`     (max weight) beyond which weights are considered     `0`    , we have     `ceil(sqrt(-log(0.01)*2)*sigma) ~ ceil(3.7*sigma)`     as the rough estimate of the filter width.

## Return Value

An initialized Gaussian blur filter object.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)