# kingzyphornet/noisegen architecture

> Architecture diagram of the GitHub repository kingzyphornet/noisegen, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kingzyphornet/noisegen
- Repository: https://github.com/kingzyphornet/noisegen

## Overview

NoiseGen is a small Python library for generating seeded 2D noise maps and converting normalized values into grayscale PNG heightmaps. Its main workflow is noise generation followed by image conversion and saving. The sampled implementation also supports interpolation, value noise, and layered octaves. Terrain-specific controls and Minecraft-oriented generation are documented as future goals, not current runtime components.

Main entry points: [`src/noisegen/image.py`](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/image.py) (PNG saver), [`src/noisegen/noise.py`](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py) (Interpolated map)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_noise["Noise Generation"]
  node_random_map["Random map<br/>[noise.py]"]
  node_interpolated_map["Interpolated map<br/>[noise.py]"]
  node_value_noise["Value noise<br/>[noise.py]"]
  node_octave_noise["Octave noise<br/>[noise.py]"]
  node_lerp["Linear interpolation<br/>[noise.py]"]
end

subgraph group_images["Image Output"]
  node_grayscale["Grayscale conversion<br/>[image.py]"]
  node_pillow["Pillow image API"]
  node_png_saver["PNG saver<br/>[image.py]"]
  node_png_file["PNG heightmap"]
end

node_user(("Library caller"))

node_user -->|"requests map"| node_random_map
node_user -->|"requests map"| node_interpolated_map
node_user -->|"requests map"| node_value_noise
node_user -->|"requests map"| node_octave_noise
node_interpolated_map -->|"generates base"| node_random_map
node_interpolated_map -->|"interpolates"| node_lerp
node_value_noise -->|"interpolates"| node_lerp
node_octave_noise -->|"generates octaves"| node_value_noise
node_png_saver -->|"converts map"| node_grayscale
node_grayscale -->|"creates image"| node_pillow
node_png_saver -->|"saves PNG"| node_pillow
node_png_saver -->|"writes image"| node_png_file

click node_random_map "https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py"
click node_interpolated_map "https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py"
click node_value_noise "https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py"
click node_octave_noise "https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py"
click node_lerp "https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py"
click node_grayscale "https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/image.py"
click node_png_saver "https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/image.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_random_map,node_interpolated_map,node_value_noise,node_octave_noise,node_lerp toneBlue
class node_grayscale,node_pillow,node_png_saver,node_png_file toneAmber
class node_user toneIndigo
```

## Components

### Noise Generation

- [Random map](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py): `src/noisegen/noise.py`
- [Interpolated map](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py): `src/noisegen/noise.py`
- [Value noise](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py): `src/noisegen/noise.py`
- [Octave noise](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py): `src/noisegen/noise.py`
- [Linear interpolation](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/noise.py): `src/noisegen/noise.py`

### Image Output

- [Grayscale conversion](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/image.py): `src/noisegen/image.py`
- **Pillow image API**
- [PNG saver](https://github.com/kingzyphornet/noisegen/blob/main/src/noisegen/image.py): `src/noisegen/image.py`
- **PNG heightmap**

### Other components

- **Library caller**

## Connections

- Library caller → Random map: requests map (evidence: `README.md`)
- Library caller → Interpolated map: requests map (evidence: `README.md`)
- Library caller → Value noise: requests map (evidence: `README.md`)
- Library caller → Octave noise: requests map (evidence: `README.md`)
- Interpolated map → Random map: generates base (evidence: `src/noisegen/noise.py`)
- Interpolated map → Linear interpolation: interpolates (evidence: `src/noisegen/noise.py`)
- Value noise → Linear interpolation: interpolates (evidence: `src/noisegen/noise.py`)
- Octave noise → Value noise: generates octaves (evidence: `src/noisegen/noise.py`)
- PNG saver → Grayscale conversion: converts map (evidence: `src/noisegen/image.py`)
- Grayscale conversion → Pillow image API: creates image (evidence: `src/noisegen/image.py`)
- PNG saver → Pillow image API: saves PNG (evidence: `src/noisegen/image.py`)
- PNG saver → PNG heightmap: writes image (evidence: `src/noisegen/image.py`)
