# Blur the background in iOS

> Enable subject segmentation and adjust background blur strength in a Nosmai iOS camera preview.

> For AI agents: the complete documentation index is at https://nosmai.com/llms/effects.txt

Product: Nosmai Effects
Group: guide
Source: https://nosmai.com/docs/effects/guides/background/blur-the-background/ios/

## Prerequisites

- A working [iOS quickstart](/docs/effects/quickstart/ios/)
- Background effects enabled for the project

## Enable blur

```objc
NosmaiBackgroundSegmentationConfig *config =
    [[NosmaiBackgroundSegmentationConfig alloc] init];
config.mode = NosmaiBackgroundSegmentationModeBlur;
config.blurStrength = 50.0f;

[[NosmaiCore shared].effects setBackgroundSegmentation:config];
```

`blurStrength` uses `0` through `100`. Apply an updated configuration when the
user changes the slider.

## Disable blur

```objc
[[NosmaiCore shared].effects clearBackgroundSegmentation];
```

## Verify it worked

The subject should stay sharp while the scene behind it becomes blurred.

## Common errors

| Symptom | Fix |
| --- | --- |
| Blur covers the subject edge | Improve lighting and reduce fast motion |
| Preview slows | Start at 720p and test the Release build on the lowest supported device |
| No blur | Check advanced-filter capability and camera readiness |

## Next steps

- [Replace the background in iOS](/docs/effects/guides/background/replace-the-background/ios/)
- [Review performance limits](/docs/effects/limits-and-performance/)

## References

- [iOS platform guide](/docs/effects/platforms/ios/)
