# alfarizi25/image-enhancement-new architecture

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

- Interactive diagram: https://gitdiagram.com/alfarizi25/image-enhancement-new
- Repository: https://github.com/alfarizi25/image-enhancement-new

## Overview

This is a Streamlit application for low-light image enhancement. Users upload JPEGs, tune CLAHE and NLM parameters, run enhancement, compare results and quality metrics, and download an Excel log. The app coordinates processing and metric calculations; gallery, histogram, and report features are implemented in the same app file. The README is empty, so the map relies on the supplied source excerpts and index; unsampled app sections may contain additional details.

Main entry points: [`app.py`](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py) (Batch Orchestrator), [`src/processing.py`](https://github.com/alfarizi25/image-enhancement-new/blob/main/src/processing.py) (CLAHE Enhancement), [`src/metrics.py`](https://github.com/alfarizi25/image-enhancement-new/blob/main/src/metrics.py) (Quality Metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_controls["Upload and Controls<br/>[app.py]"]
  node_batch["Batch Orchestrator<br/>[app.py]"]
  node_validation["Image Validation<br/>[app.py]"]
  node_session["Session Results<br/>[app.py]"]
  node_gallery["Results Gallery<br/>[app.py]"]
  node_histogram["Interactive Histograms<br/>[app.py]"]
end

subgraph group_enhancement["Image Enhancement"]
  node_clahe["CLAHE Enhancement<br/>[processing.py]"]
  node_nlm["NLM Denoising<br/>[processing.py]"]
end

subgraph group_evaluation["Evaluation and Reporting"]
  node_metrics["Quality Metrics<br/>[metrics.py]"]
  node_log["Experiment Log<br/>[app.py]"]
  node_export["Excel Download<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"uploads and configures"| node_controls
node_controls -->|"starts batch"| node_batch
node_batch -->|"checks images"| node_validation
node_batch -->|"applies CLAHE"| node_clahe
node_batch -->|"denoises CLAHE result"| node_nlm
node_batch -->|"calculates scores"| node_metrics
node_batch -->|"stores results"| node_session
node_session -->|"renders images"| node_gallery
node_gallery -->|"plots distributions"| node_histogram
node_session -->|"accumulates metrics"| node_log
node_log -->|"creates download"| node_export
node_user -->|"downloads report"| node_export

click node_controls "https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py"
click node_batch "https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py"
click node_validation "https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py"
click node_session "https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py"
click node_clahe "https://github.com/alfarizi25/image-enhancement-new/blob/main/src/processing.py"
click node_nlm "https://github.com/alfarizi25/image-enhancement-new/blob/main/src/processing.py"
click node_metrics "https://github.com/alfarizi25/image-enhancement-new/blob/main/src/metrics.py"
click node_gallery "https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py"
click node_histogram "https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py"
click node_log "https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py"
click node_export "https://github.com/alfarizi25/image-enhancement-new/blob/main/app.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_controls,node_batch,node_validation,node_session,node_gallery,node_histogram,node_user toneBlue
class node_clahe,node_nlm toneAmber
class node_metrics,node_log,node_export toneMint
```

## Components

### User Interface

- [Upload and Controls](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py): `app.py`
- [Batch Orchestrator](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py): `app.py`
- [Image Validation](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py): `app.py`
- [Session Results](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py): `app.py`
- [Results Gallery](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py): `app.py`
- [Interactive Histograms](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py): `app.py`

### Image Enhancement

- [CLAHE Enhancement](https://github.com/alfarizi25/image-enhancement-new/blob/main/src/processing.py): `src/processing.py`
- [NLM Denoising](https://github.com/alfarizi25/image-enhancement-new/blob/main/src/processing.py): `src/processing.py`

### Evaluation and Reporting

- [Quality Metrics](https://github.com/alfarizi25/image-enhancement-new/blob/main/src/metrics.py): `src/metrics.py`
- [Experiment Log](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py): `app.py`
- [Excel Download](https://github.com/alfarizi25/image-enhancement-new/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- User → Upload and Controls: uploads and configures (evidence: `app.py`)
- Upload and Controls → Batch Orchestrator: starts batch (evidence: `app.py`)
- Batch Orchestrator → Image Validation: checks images (evidence: `app.py`)
- Batch Orchestrator → CLAHE Enhancement: applies CLAHE (evidence: `app.py`)
- Batch Orchestrator → NLM Denoising: denoises CLAHE result (evidence: `app.py`)
- Batch Orchestrator → Quality Metrics: calculates scores (evidence: `app.py`)
- Batch Orchestrator → Session Results: stores results (evidence: `app.py`)
- Session Results → Results Gallery: renders images (evidence: `app.py`)
- Results Gallery → Interactive Histograms: plots distributions (evidence: `app.py`)
- Session Results → Experiment Log: accumulates metrics (evidence: `app.py`)
- Experiment Log → Excel Download: creates download (evidence: `app.py`)
- User → Excel Download: downloads report (evidence: `app.py`)
