# velvitty/scanner architecture

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

- Interactive diagram: https://gitdiagram.com/velvitty/scanner
- Repository: https://github.com/velvitty/scanner

## Overview

Posity is a browser-based color-negative film conversion tool. The documented workflow runs from local scan selection and decoding through film/base analysis and either classic or Ai+ rendering to preview and export. The tree contains no source-code excerpts, so nodes use only exact paths present in the tree; relationships below are based on the README’s documented workflow and capabilities.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Local input"]
  node_scan["Scan files"]
  node_decoder["Image decoding"]
  node_preview["Preview scaling"]
end

subgraph group_analysis["Film analysis"]
  node_base["Base detection"]
  node_mask["Film mask"]
  node_histogram["Tone analysis"]
end

subgraph group_render["Image rendering"]
  node_classic["Classic rendering"]
  node_aiplus["Ai+ rendering"]
end

subgraph group_interface["Editing and preview"]
  node_controls["Image adjustments"]
  node_filmstrip["Filmstrip navigation"]
  node_preview_ui["Photo preview"]
  node_loupe["1:1 magnifier"]
end

subgraph group_output["Export"]
  node_export["Single export"]
  node_batch["Batch ZIP export"]
  node_saved["Saved images"]
end

node_user(("Photographer"))

node_user -->|"selects or drops"| node_scan
node_scan -->|"decodes"| node_decoder
node_decoder -->|"creates preview"| node_preview
node_preview -->|"analyzes"| node_base
node_base -->|"guides detection"| node_mask
node_mask -->|"selects pixels"| node_histogram
node_histogram -->|"sets tone bounds"| node_classic
node_histogram -->|"informs analysis"| node_aiplus
node_classic -->|"renders preview"| node_preview_ui
node_aiplus -->|"renders preview"| node_preview_ui
node_user -->|"adjusts image"| node_controls
node_controls -->|"updates display"| node_preview_ui
node_user -->|"chooses frame"| node_filmstrip
node_filmstrip -->|"selects photo"| node_preview_ui
node_preview_ui -->|"supports inspection"| node_loupe
node_user -->|"exports current photo"| node_export
node_user -->|"exports collection"| node_batch
node_export -->|"writes image"| node_saved
node_batch -->|"writes ZIP contents"| node_saved

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_scan,node_decoder,node_preview toneBlue
class node_base,node_mask,node_histogram toneAmber
class node_classic,node_aiplus toneMint
class node_controls,node_filmstrip,node_preview_ui,node_loupe toneRose
class node_export,node_batch,node_saved,node_user toneIndigo
```

## Components

### Local input

- **Scan files**
- **Image decoding**
- **Preview scaling**

### Film analysis

- **Base detection**
- **Film mask**
- **Tone analysis**

### Image rendering

- **Classic rendering**
- **Ai+ rendering**

### Editing and preview

- **Image adjustments**
- **Filmstrip navigation**
- **Photo preview**
- **1:1 magnifier**

### Export

- **Single export**
- **Batch ZIP export**
- **Saved images**

### Other components

- **Photographer**

## Connections

- Photographer → Scan files: selects or drops (evidence: `README.md`)
- Scan files → Image decoding: decodes (evidence: `README.md`)
- Image decoding → Preview scaling: creates preview (evidence: `README.md`)
- Preview scaling → Base detection: analyzes (evidence: `README.md`)
- Base detection → Film mask: guides detection (evidence: `README.md`)
- Film mask → Tone analysis: selects pixels (evidence: `README.md`)
- Tone analysis → Classic rendering: sets tone bounds (evidence: `README.md`)
- Tone analysis → Ai+ rendering: informs analysis (evidence: `README.md`)
- Classic rendering → Photo preview: renders preview (evidence: `README.md`)
- Ai+ rendering → Photo preview: renders preview (evidence: `README.md`)
- Photographer → Image adjustments: adjusts image (evidence: `README.md`)
- Image adjustments → Photo preview: updates display (evidence: `README.md`)
- Photographer → Filmstrip navigation: chooses frame (evidence: `README.md`)
- Filmstrip navigation → Photo preview: selects photo (evidence: `README.md`)
- Photo preview → 1:1 magnifier: supports inspection (evidence: `README.md`)
- Photographer → Single export: exports current photo (evidence: `README.md`)
- Photographer → Batch ZIP export: exports collection (evidence: `README.md`)
- Single export → Saved images: writes image (evidence: `README.md`)
- Batch ZIP export → Saved images: writes ZIP contents (evidence: `README.md`)
