---
title: "scatter"
description: "Scatters every pixel of the child by a random offset: a grainy diffusion, not a smooth blur."
group: "effects"
groupTitle: "Filters & effects"
categoryId: "effects.blurs"
categorySlug: "effects-blurs"
categoryTitle: "Blurs, glows & screens"
kind: "function"
sourceUrl: "https://github.com/shader-effects-inc/shaders/blob/main/packages/core/src/std/effects/blurs.ts#L491"
---

# scatter

Scatters every pixel of the child by a random offset: a grainy diffusion, not a smooth blur.

```ts
scatter(opts: {amount: ArgSpec; edges: PropRef; chromatic?: PropRef}): GatherEffect
```

Import `effects` from `shaders/std` and use `effects.blurs.scatter`.

`amount` is the largest offset in pixels. `edges` is a prop with `transform: transformEdges` and `compileTime: true` ('stretch' | 'transparent' | 'mirror' | 'wrap') that says what to read where an offset lands outside the canvas. `chromatic` (0–1, optional) scatters red and blue on their own, for a sparkly colour grain; it is off at 0, so give it `recompile: crosses(0)`.

## Parameters

| Name | Type | Notes |
|---|---|---|
| `opts` | `{amount: ArgSpec; edges: PropRef; chromatic?: PropRef}` |  |

## Example

```ts
effect: scatter({amount: p('intensity'), edges: p('edges')})
```

## See also

- [`gaussianBlur`](/docs/primitives/effects-blurs/gaussianblur) — A soft, even blur of the child.
- [`motionBlur`](/docs/primitives/effects-blurs/motionblur) — Smears the child along a path: a straight streak, an arc around a point, or a zoom out of a point.

## Used by

[DiffuseBlur](/docs/components/diffuseblur)