# geo0451/prokoptas architecture

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

- Interactive diagram: https://gitdiagram.com/geo0451/prokoptas
- Repository: https://github.com/geo0451/prokoptas

## Overview

Prokoptas converts still images through a shared Rust core, exposed by a native CLI and a browser-facing WebAssembly shell. The main flow is input selection, decoding to a common pixel model, optional image preparation, then encoding and output. The README documents PNG, JPEG and WebP CLI paths, plus broader codec modules in the core. The core processing excerpt imports the format adapters but does not show dispatch calls; those links are therefore dashed. The browser UI’s wiring is not shown in the available evidence.

Main entry points: [`crates/prok-core/src/processing.rs`](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/processing.rs) (Conversion processing), [`crates/prok-cli/src/main.rs`](https://github.com/geo0451/prokoptas/blob/main/crates/prok-cli/src/main.rs) (Native CLI), [`web/src/main.js`](https://github.com/geo0451/prokoptas/blob/main/web/src/main.js) (Browser UI), [`crates/prok-wasm/src/lib.rs`](https://github.com/geo0451/prokoptas/blob/main/crates/prok-wasm/src/lib.rs) (WebAssembly shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surfaces["User surfaces"]
  node_cli["Native CLI<br/>[main.rs]"]
  node_browser["Browser UI<br/>[main.js]"]
  node_wasm["WebAssembly shell<br/>[lib.rs]"]
end

subgraph group_pipeline["Conversion core"]
  node_processing["Conversion processing<br/>[processing.rs]"]
  node_registry["Format registry<br/>[registry.rs]"]
  node_codec["Codec contracts<br/>[codec.rs]"]
end

subgraph group_formats["Format adapters"]
  node_avif["AVIF adapter<br/>[avif.rs]"]
  node_bmp["BMP adapter<br/>[bmp.rs]"]
  node_heic["HEIC decoder<br/>[heic.rs]"]
  node_jpeg["JPEG adapter<br/>[jpeg.rs]"]
  node_jxl["JPEG XL adapter<br/>[jxl.rs]"]
  node_png["PNG adapter<br/>[png.rs]"]
  node_raw["RAW decoder<br/>[raw.rs]"]
  node_tiff["TIFF adapter<br/>[tiff.rs]"]
  node_webp["WebP adapter<br/>[webp.rs]"]
end

subgraph group_model["Image model"]
  node_options["Conversion options<br/>[options.rs]"]
  node_image["Decoded image model<br/>[image.rs]"]
end

node_user(("User"))

node_user -->|"runs conversion"| node_cli
node_cli -->|"uses shared core"| node_processing
node_user -.->|"uses browser tool"| node_browser
node_browser -.->|"invokes shell"| node_wasm
node_wasm -->|"uses shared core"| node_processing
node_processing -->|"applies options"| node_options
node_processing -->|"prepares pixels"| node_image
node_processing -.->|"selects formats"| node_registry
node_processing -.->|"uses contracts"| node_codec
node_processing -.->|"dispatches codec"| node_avif
node_processing -.->|"dispatches codec"| node_bmp
node_processing -.->|"dispatches decoder"| node_heic
node_processing -.->|"dispatches codec"| node_jpeg
node_processing -.->|"dispatches codec"| node_jxl
node_processing -.->|"dispatches codec"| node_png
node_processing -.->|"dispatches decoder"| node_raw
node_processing -.->|"dispatches codec"| node_tiff
node_processing -.->|"dispatches codec"| node_webp

click node_cli "https://github.com/geo0451/prokoptas/blob/main/crates/prok-cli/src/main.rs"
click node_browser "https://github.com/geo0451/prokoptas/blob/main/web/src/main.js"
click node_wasm "https://github.com/geo0451/prokoptas/blob/main/crates/prok-wasm/src/lib.rs"
click node_processing "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/processing.rs"
click node_registry "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/registry.rs"
click node_codec "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/codec.rs"
click node_options "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/options.rs"
click node_image "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/image.rs"
click node_avif "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/avif.rs"
click node_bmp "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/bmp.rs"
click node_heic "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/heic.rs"
click node_jpeg "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/jpeg.rs"
click node_jxl "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/jxl.rs"
click node_png "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/png.rs"
click node_raw "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/raw.rs"
click node_tiff "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/tiff.rs"
click node_webp "https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/webp.rs"

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_cli,node_browser,node_wasm,node_user toneBlue
class node_processing,node_registry,node_codec toneAmber
class node_avif,node_bmp,node_heic,node_jpeg,node_jxl,node_png,node_raw,node_tiff,node_webp toneMint
class node_options,node_image toneRose
```

## Components

### User surfaces

- [Native CLI](https://github.com/geo0451/prokoptas/blob/main/crates/prok-cli/src/main.rs): `crates/prok-cli/src/main.rs`
- [Browser UI](https://github.com/geo0451/prokoptas/blob/main/web/src/main.js): `web/src/main.js`
- [WebAssembly shell](https://github.com/geo0451/prokoptas/blob/main/crates/prok-wasm/src/lib.rs): `crates/prok-wasm/src/lib.rs`

### Conversion core

- [Conversion processing](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/processing.rs): `crates/prok-core/src/processing.rs`
- [Format registry](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/registry.rs): `crates/prok-core/src/registry.rs`
- [Codec contracts](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/codec.rs): `crates/prok-core/src/codec.rs`

### Format adapters

- [AVIF adapter](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/avif.rs): `crates/prok-core/src/avif.rs`
- [BMP adapter](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/bmp.rs): `crates/prok-core/src/bmp.rs`
- [HEIC decoder](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/heic.rs): `crates/prok-core/src/heic.rs`
- [JPEG adapter](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/jpeg.rs): `crates/prok-core/src/jpeg.rs`
- [JPEG XL adapter](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/jxl.rs): `crates/prok-core/src/jxl.rs`
- [PNG adapter](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/png.rs): `crates/prok-core/src/png.rs`
- [RAW decoder](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/raw.rs): `crates/prok-core/src/raw.rs`
- [TIFF adapter](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/tiff.rs): `crates/prok-core/src/tiff.rs`
- [WebP adapter](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/webp.rs): `crates/prok-core/src/webp.rs`

### Image model

- [Conversion options](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/options.rs): `crates/prok-core/src/options.rs`
- [Decoded image model](https://github.com/geo0451/prokoptas/blob/main/crates/prok-core/src/image.rs): `crates/prok-core/src/image.rs`

### Other components

- **User**

## Connections

- User → Native CLI: runs conversion (evidence: `README.md`)
- Native CLI → Conversion processing: uses shared core (evidence: `README.md`)
- User → Browser UI: uses browser tool
- Browser UI → WebAssembly shell: invokes shell
- WebAssembly shell → Conversion processing: uses shared core (evidence: `README.md`)
- Conversion processing → Conversion options: applies options (evidence: `crates/prok-core/src/processing.rs`)
- Conversion processing → Decoded image model: prepares pixels (evidence: `crates/prok-core/src/processing.rs`)
- Conversion processing → Format registry: selects formats
- Conversion processing → Codec contracts: uses contracts (evidence: `crates/prok-core/src/codec.rs`)
- Conversion processing → AVIF adapter: dispatches codec
- Conversion processing → BMP adapter: dispatches codec
- Conversion processing → HEIC decoder: dispatches decoder
- Conversion processing → JPEG adapter: dispatches codec
- Conversion processing → JPEG XL adapter: dispatches codec
- Conversion processing → PNG adapter: dispatches codec
- Conversion processing → RAW decoder: dispatches decoder
- Conversion processing → TIFF adapter: dispatches codec
- Conversion processing → WebP adapter: dispatches codec
