# dezoomify/dezoomify-rs architecture

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

- Interactive diagram: https://gitdiagram.com/dezoomify/dezoomify-rs
- Repository: https://github.com/dezoomify/dezoomify-rs

## Overview

dezoomify-rs is a desktop tiled-image downloader. The workflow accepts a URL or custom tile description, discovers image metadata and tile requests, downloads and decodes tiles, then writes the chosen output format. The core separates protocol discovery from the application’s HTTP, tile-processing, and encoding work. README-documented dezoomers are included as capability branches; their exact runtime dispatch was not shown in the excerpts, so those links are marked unverified.

Main entry points: [`dezoomify-core/src/core/registry.rs`](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/core/registry.rs) (Dezoomer registry), [`src/lib.rs`](https://github.com/dezoomify/dezoomify-rs/blob/master/src/lib.rs) (Download orchestration), [`src/download_state.rs`](https://github.com/dezoomify/dezoomify-rs/blob/master/src/download_state.rs) (Tile downloads), [`dezoomify-core/src/core/discovery.rs`](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/core/discovery.rs) (Discovery operation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and orchestration"]
  node_entry["CLI entry<br/>[main.rs]"]
  node_arguments["Arguments<br/>[arguments.rs]"]
  node_app["Download orchestration<br/>[lib.rs]"]
end

subgraph group_discovery["Discovery core"]
  node_registry["Dezoomer registry<br/>[registry.rs]"]
  node_discoveryop["Discovery operation<br/>[discovery.rs]"]
  node_tileplan["Tile plans<br/>[tile_plan.rs]"]
end

subgraph group_protocols["Image protocols"]
  node_zoomify["Zoomify and DZI<br/>[mod.rs]"]
  node_iiif["IIIF and manifests<br/>[mod.rs]"]
  node_krpano["Krpano panoramas<br/>[mod.rs]"]
  node_google["Google Arts<br/>[mod.rs]"]
  node_otherprotocols["Other dezoomers"]
end

subgraph group_download["Download and output"]
  node_downloads["Tile downloads<br/>[download_state.rs]"]
  node_network["HTTP and cache<br/>[network.rs]"]
  node_tile["Tile decoding<br/>[tile.rs]"]
  node_buffer["Tile buffer<br/>[tile_buffer.rs]"]
  node_encoder["Output encoders<br/>[mod.rs]"]
  node_output["Output files<br/>[output_file.rs]"]
end

node_user(("User"))

node_user -->|"runs"| node_entry
node_entry -.->|"accepts options"| node_arguments
node_arguments -->|"configures"| node_app
node_app -->|"discovers images"| node_discoveryop
node_registry -->|"starts discovery"| node_discoveryop
node_registry -.->|"dispatches to"| node_zoomify
node_registry -.->|"dispatches to"| node_iiif
node_registry -.->|"dispatches to"| node_krpano
node_registry -.->|"dispatches to"| node_google
node_registry -.->|"dispatches to"| node_otherprotocols
node_discoveryop -->|"describes tiles"| node_tileplan
node_app -->|"coordinates downloads"| node_downloads
node_downloads -->|"fetches tiles"| node_network
node_downloads -->|"processes tiles"| node_tile
node_downloads -->|"adds tiles"| node_buffer
node_app -->|"selects encoder"| node_encoder
node_encoder -.->|"writes result"| node_output

click node_entry "https://github.com/dezoomify/dezoomify-rs/blob/master/src/main.rs"
click node_arguments "https://github.com/dezoomify/dezoomify-rs/blob/master/src/arguments.rs"
click node_app "https://github.com/dezoomify/dezoomify-rs/blob/master/src/lib.rs"
click node_registry "https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/core/registry.rs"
click node_discoveryop "https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/core/discovery.rs"
click node_tileplan "https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/core/tile_plan.rs"
click node_zoomify "https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/zoomify/mod.rs"
click node_iiif "https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/iiif/mod.rs"
click node_krpano "https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/krpano/mod.rs"
click node_google "https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/google_arts_and_culture/mod.rs"
click node_otherprotocols "https://github.com/dezoomify/dezoomify-rs/tree/master/dezoomify-core/src"
click node_downloads "https://github.com/dezoomify/dezoomify-rs/blob/master/src/download_state.rs"
click node_network "https://github.com/dezoomify/dezoomify-rs/blob/master/src/network.rs"
click node_tile "https://github.com/dezoomify/dezoomify-rs/blob/master/src/tile.rs"
click node_buffer "https://github.com/dezoomify/dezoomify-rs/blob/master/src/encoder/tile_buffer.rs"
click node_encoder "https://github.com/dezoomify/dezoomify-rs/blob/master/src/encoder/mod.rs"
click node_output "https://github.com/dezoomify/dezoomify-rs/blob/master/src/output_file.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_entry,node_arguments,node_app,node_user toneBlue
class node_registry,node_discoveryop,node_tileplan toneAmber
class node_zoomify,node_iiif,node_krpano,node_google,node_otherprotocols toneMint
class node_downloads,node_network,node_tile,node_buffer,node_encoder,node_output toneRose
```

## Components

### CLI and orchestration

- [CLI entry](https://github.com/dezoomify/dezoomify-rs/blob/master/src/main.rs): `src/main.rs`
- [Arguments](https://github.com/dezoomify/dezoomify-rs/blob/master/src/arguments.rs): `src/arguments.rs`
- [Download orchestration](https://github.com/dezoomify/dezoomify-rs/blob/master/src/lib.rs): `src/lib.rs`

### Discovery core

- [Dezoomer registry](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/core/registry.rs): `dezoomify-core/src/core/registry.rs`
- [Discovery operation](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/core/discovery.rs): `dezoomify-core/src/core/discovery.rs`
- [Tile plans](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/core/tile_plan.rs): `dezoomify-core/src/core/tile_plan.rs`

### Image protocols

- [Zoomify and DZI](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/zoomify/mod.rs): `dezoomify-core/src/zoomify/mod.rs`
- [IIIF and manifests](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/iiif/mod.rs): `dezoomify-core/src/iiif/mod.rs`
- [Krpano panoramas](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/krpano/mod.rs): `dezoomify-core/src/krpano/mod.rs`
- [Google Arts](https://github.com/dezoomify/dezoomify-rs/blob/master/dezoomify-core/src/google_arts_and_culture/mod.rs): `dezoomify-core/src/google_arts_and_culture/mod.rs`
- [Other dezoomers](https://github.com/dezoomify/dezoomify-rs/tree/master/dezoomify-core/src): `dezoomify-core/src`

### Download and output

- [Tile downloads](https://github.com/dezoomify/dezoomify-rs/blob/master/src/download_state.rs): `src/download_state.rs`
- [HTTP and cache](https://github.com/dezoomify/dezoomify-rs/blob/master/src/network.rs): `src/network.rs`
- [Tile decoding](https://github.com/dezoomify/dezoomify-rs/blob/master/src/tile.rs): `src/tile.rs`
- [Tile buffer](https://github.com/dezoomify/dezoomify-rs/blob/master/src/encoder/tile_buffer.rs): `src/encoder/tile_buffer.rs`
- [Output encoders](https://github.com/dezoomify/dezoomify-rs/blob/master/src/encoder/mod.rs): `src/encoder/mod.rs`
- [Output files](https://github.com/dezoomify/dezoomify-rs/blob/master/src/output_file.rs): `src/output_file.rs`

### Other components

- **User**

## Connections

- User → CLI entry: runs
- CLI entry → Arguments: accepts options
- Arguments → Download orchestration: configures (evidence: `src/lib.rs`)
- Download orchestration → Discovery operation: discovers images (evidence: `src/lib.rs`)
- Dezoomer registry → Discovery operation: starts discovery (evidence: `dezoomify-core/src/core/discovery.rs`)
- Dezoomer registry → Zoomify and DZI: dispatches to
- Dezoomer registry → IIIF and manifests: dispatches to
- Dezoomer registry → Krpano panoramas: dispatches to
- Dezoomer registry → Google Arts: dispatches to
- Dezoomer registry → Other dezoomers: dispatches to (evidence: `dezoomify-core/src/core/discovery.rs`)
- Discovery operation → Tile plans: describes tiles (evidence: `dezoomify-core/src/core/mod.rs`)
- Download orchestration → Tile downloads: coordinates downloads (evidence: `src/lib.rs`)
- Tile downloads → HTTP and cache: fetches tiles (evidence: `src/download_state.rs`)
- Tile downloads → Tile decoding: processes tiles (evidence: `src/download_state.rs`)
- Tile downloads → Tile buffer: adds tiles (evidence: `src/download_state.rs`)
- Download orchestration → Output encoders: selects encoder (evidence: `src/encoder/mod.rs`)
- Output encoders → Output files: writes result
