# fractal-noise

> Fractal noise library

Latest version **3.0.0** (published 2026-08-23) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install fractal-noise
pnpm add fractal-noise
yarn add fractal-noise
bun add fractal-noise
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-08-23 |
| First published | 2017-02-14 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 0 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 60 |
| Author | Josh Forisha |
| Maintainers | joshforisha |
| Keywords | noise, procedural-generation |

## Links

- npm: https://www.npmjs.com/package/fractal-noise
- Repository: https://github.com/joshforisha/fractal-noise
- Homepage: https://github.com/joshforisha/fractal-noise#readme
- Issues: https://github.com/joshforisha/fractal-noise/issues
- npm.io page: https://npm.io/package/fractal-noise

## Recent versions

- 3.0.0 (latest) — 2026-08-23
- 3.0.0-pre2 (pre) — 2026-08-23
- 3.0.0-pre1 — 2026-08-23
- 2.1.0 — 2023-01-25
- 2.1.0-pre2 — 2023-01-25
- 2.1.0-pre1 — 2022-11-05
- 2.0.0 — 2022-11-05
- 2.0.0-pre1 — 2022-11-05
- 1.2.0 — 2021-04-19
- 1.1.0 — 2020-12-31
- 1.0.0 — 2019-10-28
- 0.9.0 — 2017-02-16
- 0.8.0 — 2017-02-16
- 0.7.0 — 2017-02-16
- 0.6.0 — 2017-02-16
- … 8 more at https://npm.io/package/fractal-noise/versions

## README

# Fractal Noise

Fractal noise functions designed to be used with any noise generation algorithm.

- JSR package: [@joshforisha/fractal-noise](https://jsr.io/@joshforisha/fractal-noise)
- NPM package: [fractal-noise](https://www.npmjs.com/package/fractal-noise)

## Examples

These images were all generated using basic value noise with `width: 888` and `height: 111`.

```javascript
makeCylinderSurface(width, height, valueNoise3D, {
  frequency: 0.04,
  octaves: 2,
});
```

![Low frequency, double octave cylinder](https://raw.githubusercontent.com/joshforisha/fractal-noise-js/main/images/cylinder-low-2.png)

```javascript
makeCylinderSurface(width, height, valueNoise3D, {
  frequency: 0.06,
  octaves: 8,
});
```

![Medium frequency, high octave cylinder](https://raw.githubusercontent.com/joshforisha/fractal-noise-js/main/images/cylinder-medium-8.png)

```javascript
makeLine(width, valueNoise1D); // (Replicated across y-axis)
```

![Default line](https://raw.githubusercontent.com/joshforisha/fractal-noise-js/main/images/line-default.png)

```javascript
makeLine(height, valueNoise1D, { frequency: 0.1 }); // (Replicated across x-axis)
```

![High frequency line](https://raw.githubusercontent.com/joshforisha/fractal-noise-js/main/images/line-high.png)

```javascript
makeRectangle(width, height, valueNoise2D);
```

![Default rectangle](https://raw.githubusercontent.com/joshforisha/fractal-noise-js/main/images/rectangle-default.png)

```javascript
makeRectangle(width, height, valueNoise2D, { frequency: 0.04, octaves: 8 });
```

![Low frequency, high octave rectangle](https://raw.githubusercontent.com/joshforisha/fractal-noise-js/main/images/rectangle-low-8.png)

## API

##### `interface Options { amplitude?; frequency?; octaves?; persistence? }`

- `amplitude?: number` – Defaults to `1.0`
- `frequency?: number` – Defaults to `1.0`
- `octaves?: number` – Defaults to `1`
- `persistence?: number` – Defaults to `0.5`
- `scale?: (x: number) => number` – Defaults to `undefined`

##### `makeCuboid(width, height, depth, noise3, options?): number[][][]`

- `width: number`
- `height: number`
- `depth: number`
- `noise3: (x: number, y: number, z: number) => number`
- `options?: Options = {}`

Generates a three-dimensional noise field for a rectangular cuboid.

##### `makeCylinderSurface(circumference, height, noise3, options?): number[][]`

- `circumference: number`
- `height: number`
- `noise3: (x: number, y: number, z: number) => number`
- `options?: Options = {}`

Generates a two-dimensional noise field formed around a three-dimensional cylinder, such that it is continuous across the x-boundaries.

##### `makeLine(length, noise1, options?): number[]`

- `length: number`
- `noise1: (x: number) => number`
- `options?: Options = {}`

Generates a one-dimensional noise field.

##### `makeRectangle(width, height, noise2, options?): number[][]`

- `width: number`
- `height: number`
- `noise2: (x: number, y: number) => number`
- `options?: Options = {}`

Generates a two-dimensional noise field isolated to `width` and `height` (non-continuous noise).

##### `makeSphereSurface(circumference, options?): number[][]`

- `circumference: number`
- `noise3: (x: number, y: number, z: number) => number`
- `options?: Options = {}`

Generates a two-dimensional noise field formed on the surface of a three-dimensional sphere.

---
_Source: https://npm.io/package/fractal-noise · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
