# delphykmc/pixelscope architecture

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

- Interactive diagram: https://gitdiagram.com/delphykmc/pixelscope
- Repository: https://github.com/delphykmc/pixelscope

## Overview

PixelScope is a CPU-only desktop image comparison and analysis application. Users register image files or folders, select sources, and inspect them in synchronized viewers; selections beyond six are presented as comparison pages. The workflow extends from image decoding and RAW/YUV interpretation through native-data analysis and display. The graph also preserves documented Difference, statistics, histogram, line-profile, ROI, session, and optional reference-IQA capabilities. Some subsystem links rely on README documentation because their implementation files were not sampled.

Main entry points: [`src/pixelscope/workers/image_load_worker.py`](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/workers/image_load_worker.py) (Image loading), [`src/pixelscope/app/main_window.py`](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/app/main_window.py) (Workspace and selection), [`src/pixelscope/ui/comparison_analysis_panel.py`](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/comparison_analysis_panel.py) (Comparison analysis), [`src/pixelscope/app/registration_controller.py`](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/app/registration_controller.py) (File and folder registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_launcher["Application launcher<br/>[application.py]"]
  node_window["Workspace and selection<br/>[main_window.py]"]
end

subgraph group_input["Registration and Input"]
  node_registration["File and folder registration"]
  node_discovery["Path discovery<br/>[path_discovery.py]"]
  node_rawdialog["RAW profile dialog<br/>[raw_open_dialog.py]"]
  node_rawprofile["RAW profile<br/>[raw_profile.py]"]
  node_rawformat["RAW storage formats<br/>[raw_format.py]"]
  node_loadworker["Image loading"]
  node_taskworker["Background task lifecycle<br/>[task_worker.py]"]
  node_readers["Image and binary readers<br/>[image_reader.py]"]
  node_yuvprofile["Native YUV profiles<br/>[yuv_profile.py]"]
  node_yuvreader["Native YUV reader<br/>[yuv_reader.py]"]
end

subgraph group_analysis["Viewing and Analysis"]
  node_document["Native image document<br/>[image_document.py]"]
  node_viewer["Synchronized image viewer<br/>[image_viewer.py]"]
  node_analysispanel["Comparison analysis"]
  node_difference["Difference analysis<br/>[diff_engine.py]"]
  node_roi["ROI analysis<br/>[roi.py]"]
  node_lineprofile["Line profiles<br/>[line_profile.py]"]
end

subgraph group_extensions["Persistence and Extensions"]
  node_session["Session controls<br/>[session.py]"]
  node_sessionrepo["Session repository"]
  node_iqaextension["Reference IQA extension<br/>[extension.py]"]
  node_iqacontract["IQA public contract"]
end

node_user(("Image analyst"))

node_user -->|"launches"| node_launcher
node_launcher -->|"opens workspace"| node_window
node_user -->|"registers sources"| node_registration
node_registration -->|"discovers paths"| node_discovery
node_window -->|"routes registration"| node_registration
node_registration -.->|"requests decoding"| node_loadworker
node_user -->|"configures RAW"| node_rawdialog
node_rawdialog -->|"creates profile"| node_rawprofile
node_rawprofile -->|"validates format"| node_rawformat
node_loadworker -->|"uses lifecycle"| node_taskworker
node_loadworker -->|"decodes inputs"| node_readers
node_loadworker -->|"uses profile"| node_rawprofile
node_loadworker -->|"uses profile"| node_yuvprofile
node_loadworker -->|"decodes YUV"| node_yuvreader
node_loadworker -->|"creates document"| node_document
node_window -->|"presents pages"| node_viewer
node_viewer -->|"displays source"| node_document
node_window -->|"scopes analysis"| node_analysispanel
node_analysispanel -.->|"requests Difference"| node_difference
node_analysispanel -.->|"requests ROI metrics"| node_roi
node_analysispanel -.->|"requests profiles"| node_lineprofile
node_user -->|"restores session"| node_session
node_session -->|"reads and writes"| node_sessionrepo
node_launcher -->|"loads optional extension"| node_iqaextension
node_iqaextension -->|"uses contract"| node_iqacontract

click node_launcher "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/app/application.py"
click node_window "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/app/main_window.py"
click node_registration "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/app/registration_controller.py"
click node_discovery "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/path_discovery.py"
click node_rawdialog "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/raw_open_dialog.py"
click node_rawprofile "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/raw_profile.py"
click node_rawformat "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/raw_format.py"
click node_loadworker "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/workers/image_load_worker.py"
click node_taskworker "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/workers/task_worker.py"
click node_readers "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/image_reader.py"
click node_yuvprofile "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/yuv_profile.py"
click node_yuvreader "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/yuv_reader.py"
click node_document "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/core/image_document.py"
click node_viewer "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/image_viewer.py"
click node_analysispanel "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/comparison_analysis_panel.py"
click node_difference "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/core/diff_engine.py"
click node_roi "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/core/roi.py"
click node_lineprofile "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/core/line_profile.py"
click node_session "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/session.py"
click node_sessionrepo "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/comparison_set_repository.py"
click node_iqaextension "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope_iqa_reference/extension.py"
click node_iqacontract "https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/remote/iqa_public_contract.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_launcher,node_window toneBlue
class node_registration,node_discovery,node_rawdialog,node_rawprofile,node_rawformat,node_loadworker,node_taskworker,node_readers,node_yuvprofile,node_yuvreader toneAmber
class node_document,node_viewer,node_analysispanel,node_difference,node_roi,node_lineprofile toneMint
class node_session,node_sessionrepo,node_iqaextension,node_iqacontract toneRose
class node_user toneIndigo
```

## Components

### Application

- [Application launcher](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/app/application.py): `src/pixelscope/app/application.py`
- [Workspace and selection](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/app/main_window.py): `src/pixelscope/app/main_window.py`

### Registration and Input

- [File and folder registration](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/app/registration_controller.py): `src/pixelscope/app/registration_controller.py`
- [Path discovery](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/path_discovery.py): `src/pixelscope/io/path_discovery.py`
- [RAW profile dialog](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/raw_open_dialog.py): `src/pixelscope/ui/raw_open_dialog.py`
- [RAW profile](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/raw_profile.py): `src/pixelscope/io/raw_profile.py`
- [RAW storage formats](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/raw_format.py): `src/pixelscope/io/raw_format.py`
- [Image loading](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/workers/image_load_worker.py): `src/pixelscope/workers/image_load_worker.py`
- [Background task lifecycle](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/workers/task_worker.py): `src/pixelscope/workers/task_worker.py`
- [Image and binary readers](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/image_reader.py): `src/pixelscope/io/image_reader.py`
- [Native YUV profiles](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/yuv_profile.py): `src/pixelscope/io/yuv_profile.py`
- [Native YUV reader](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/yuv_reader.py): `src/pixelscope/io/yuv_reader.py`

### Viewing and Analysis

- [Native image document](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/core/image_document.py): `src/pixelscope/core/image_document.py`
- [Synchronized image viewer](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/image_viewer.py): `src/pixelscope/ui/image_viewer.py`
- [Comparison analysis](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/comparison_analysis_panel.py): `src/pixelscope/ui/comparison_analysis_panel.py`
- [Difference analysis](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/core/diff_engine.py): `src/pixelscope/core/diff_engine.py`
- [ROI analysis](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/core/roi.py): `src/pixelscope/core/roi.py`
- [Line profiles](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/core/line_profile.py): `src/pixelscope/core/line_profile.py`

### Persistence and Extensions

- [Session controls](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/ui/session.py): `src/pixelscope/ui/session.py`
- [Session repository](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/io/comparison_set_repository.py): `src/pixelscope/io/comparison_set_repository.py`
- [Reference IQA extension](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope_iqa_reference/extension.py): `src/pixelscope_iqa_reference/extension.py`
- [IQA public contract](https://github.com/delphykmc/pixelscope/blob/main/src/pixelscope/remote/iqa_public_contract.py): `src/pixelscope/remote/iqa_public_contract.py`

### Other components

- **Image analyst**

## Connections

- Image analyst → Application launcher: launches (evidence: `README.md`)
- Application launcher → Workspace and selection: opens workspace (evidence: `src/pixelscope/app/application.py`)
- Image analyst → File and folder registration: registers sources (evidence: `src/pixelscope/app/registration_controller.py`)
- File and folder registration → Path discovery: discovers paths (evidence: `src/pixelscope/app/registration_controller.py`)
- Workspace and selection → File and folder registration: routes registration (evidence: `src/pixelscope/app/main_window.py`)
- File and folder registration → Image loading: requests decoding
- Image analyst → RAW profile dialog: configures RAW (evidence: `README.md`)
- RAW profile dialog → RAW profile: creates profile (evidence: `src/pixelscope/ui/raw_open_dialog.py`)
- RAW profile → RAW storage formats: validates format (evidence: `src/pixelscope/io/raw_profile.py`)
- Image loading → Background task lifecycle: uses lifecycle (evidence: `src/pixelscope/workers/image_load_worker.py`)
- Image loading → Image and binary readers: decodes inputs (evidence: `src/pixelscope/workers/image_load_worker.py`)
- Image loading → RAW profile: uses profile (evidence: `src/pixelscope/workers/image_load_worker.py`)
- Image loading → Native YUV profiles: uses profile (evidence: `src/pixelscope/workers/image_load_worker.py`)
- Image loading → Native YUV reader: decodes YUV (evidence: `src/pixelscope/workers/image_load_worker.py`)
- Image loading → Native image document: creates document (evidence: `src/pixelscope/workers/image_load_worker.py`)
- Workspace and selection → Synchronized image viewer: presents pages (evidence: `README.md`)
- Synchronized image viewer → Native image document: displays source (evidence: `src/pixelscope/ui/image_viewer.py`)
- Workspace and selection → Comparison analysis: scopes analysis (evidence: `README.md`)
- Comparison analysis → Difference analysis: requests Difference
- Comparison analysis → ROI analysis: requests ROI metrics
- Comparison analysis → Line profiles: requests profiles
- Image analyst → Session controls: restores session (evidence: `README.md`)
- Session controls → Session repository: reads and writes (evidence: `src/pixelscope/ui/session.py`)
- Application launcher → Reference IQA extension: loads optional extension
- Reference IQA extension → IQA public contract: uses contract (evidence: `src/pixelscope_iqa_reference/extension.py`)
