# Blur the background in Android

> Enable subject segmentation and adjust background blur strength in a Nosmai Android 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/android/

## Prerequisites

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

## Enable blur

```java
NosmaiBackgroundSegmentationConfig config =
    new NosmaiBackgroundSegmentationConfig(
        NosmaiBackgroundSegmentationConfig.Mode.BLUR
    );
config.blurStrength = 55.0f;

NosmaiEffects.setBackgroundSegmentation(config);
```

`blurStrength` uses `0` through `100`. Update the configuration from the main
thread when a slider changes.

## Disable blur

```java
NosmaiEffects.clearBackgroundSegmentation();
```

## Verify it worked

The subject should remain visible and sharp while the scene behind it is
blurred.

## Common errors

| Symptom | Fix |
| --- | --- |
| No blur | Confirm the pipeline is ready and advanced filters are enabled |
| Edge quality changes during motion | Improve lighting and reduce camera motion |
| Lower frame rate | Use 30 FPS, lower input resolution, and profile a Release build |

## Next steps

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

## References

- [Android platform guide](/docs/effects/platforms/android/)
