# sachink-techie/loupe architecture

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

- Interactive diagram: https://gitdiagram.com/sachink-techie/loupe
- Repository: https://github.com/sachink-techie/loupe

## Overview

Loupe is a small, dual-mode image-forgery checker: it either serves a local webpage or analyzes a supplied image in the terminal. Terminal analysis fingerprints the file with MD5, runs Error Level Analysis and copy-move detection, and reports results while saving diagnostic images. The source shows the server serving index.html, but the webpage’s contents were not provided, so its browser-side capabilities are unknown.

Main entry points: [`loupe.py`](https://github.com/sachink-techie/loupe/blob/main/loupe.py) (Image analysis), [`index.html`](https://github.com/sachink-techie/loupe/blob/main/index.html) (Webpage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime modes"]
  node_loupe["CLI entry<br/>[loupe.py]"]
  node_server["Local server<br/>[loupe.py]"]
  node_handler["GET handler<br/>[loupe.py]"]
  node_page["Webpage<br/>[index.html]"]
end

subgraph group_analysis["Image analysis"]
  node_analyze["Image analysis<br/>[loupe.py]"]
  node_image["Input image"]
  node_md5["MD5 fingerprint<br/>[loupe.py]"]
  node_ela["Error-level analysis<br/>[loupe.py]"]
  node_copy_move["Copy-move check<br/>[loupe.py]"]
  node_outputs["Diagnostic images"]
end

node_user(("User"))

node_user -->|"runs"| node_loupe
node_loupe -->|"starts"| node_server
node_loupe -->|"dispatches"| node_analyze
node_server -->|"serves requests"| node_handler
node_handler -->|"reads"| node_page
node_server -->|"opens browser"| node_user
node_user -->|"supplies"| node_image
node_analyze -->|"reads"| node_image
node_analyze -->|"fingerprints"| node_md5
node_analyze -->|"runs"| node_ela
node_analyze -->|"runs"| node_copy_move
node_analyze -->|"writes"| node_outputs

click node_loupe "https://github.com/sachink-techie/loupe/blob/main/loupe.py"
click node_server "https://github.com/sachink-techie/loupe/blob/main/loupe.py"
click node_handler "https://github.com/sachink-techie/loupe/blob/main/loupe.py"
click node_page "https://github.com/sachink-techie/loupe/blob/main/index.html"
click node_analyze "https://github.com/sachink-techie/loupe/blob/main/loupe.py"
click node_md5 "https://github.com/sachink-techie/loupe/blob/main/loupe.py"
click node_ela "https://github.com/sachink-techie/loupe/blob/main/loupe.py"
click node_copy_move "https://github.com/sachink-techie/loupe/blob/main/loupe.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_loupe,node_server,node_handler,node_page,node_user toneBlue
class node_analyze,node_image,node_md5,node_ela,node_copy_move,node_outputs toneAmber
```

## Components

### Runtime modes

- [CLI entry](https://github.com/sachink-techie/loupe/blob/main/loupe.py): `loupe.py`
- [Local server](https://github.com/sachink-techie/loupe/blob/main/loupe.py): `loupe.py`
- [GET handler](https://github.com/sachink-techie/loupe/blob/main/loupe.py): `loupe.py`
- [Webpage](https://github.com/sachink-techie/loupe/blob/main/index.html): `index.html`

### Image analysis

- [Image analysis](https://github.com/sachink-techie/loupe/blob/main/loupe.py): `loupe.py`
- **Input image**
- [MD5 fingerprint](https://github.com/sachink-techie/loupe/blob/main/loupe.py): `loupe.py`
- [Error-level analysis](https://github.com/sachink-techie/loupe/blob/main/loupe.py): `loupe.py`
- [Copy-move check](https://github.com/sachink-techie/loupe/blob/main/loupe.py): `loupe.py`
- **Diagnostic images**

### Other components

- **User**

## Connections

- User → CLI entry: runs (evidence: `loupe.py`)
- CLI entry → Local server: starts (evidence: `loupe.py`)
- CLI entry → Image analysis: dispatches (evidence: `loupe.py`)
- Local server → GET handler: serves requests (evidence: `loupe.py`)
- GET handler → Webpage: reads (evidence: `loupe.py`)
- Local server → User: opens browser (evidence: `loupe.py`)
- User → Input image: supplies
- Image analysis → Input image: reads (evidence: `loupe.py`)
- Image analysis → MD5 fingerprint: fingerprints (evidence: `loupe.py`)
- Image analysis → Error-level analysis: runs (evidence: `loupe.py`)
- Image analysis → Copy-move check: runs (evidence: `loupe.py`)
- Image analysis → Diagnostic images: writes (evidence: `loupe.py`)
