# vamshi-mohan/image_steganography architecture

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

- Interactive diagram: https://gitdiagram.com/vamshi-mohan/image_steganography
- Repository: https://github.com/vamshi-mohan/image_steganography

## Overview

This is a Flask image-steganography application with web workflows for hiding messages, extracting them, and comparing image quality; watermarking.py also contains an interactive command-line workflow. The web handlers own image uploads, algorithm dispatch, result generation, and downloads. LSB and DCT implement the two hiding methods, while Compare computes MSE and PSNR. The source shows web routes rendering templates and writing result files. The README is empty, so the map reflects the sampled source; templates and generated output behavior are not inferred beyond the route code.

Main entry points: [`app.py`](https://github.com/vamshi-mohan/image_steganography/blob/main/app.py) (Web routes), [`watermarking.py`](https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.py) (Interactive workflow), [`templates/index.html`](https://github.com/vamshi-mohan/image_steganography/blob/main/templates/index.html) (Home page), [`templates/encode.html`](https://github.com/vamshi-mohan/image_steganography/blob/main/templates/encode.html) (Encode page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_home["Home page<br/>[index.html]"]
  node_webapp["Web routes<br/>[app.py]"]
  node_encodepage["Encode page<br/>[encode.html]"]
  node_decodepage["Decode page<br/>[decode.html]"]
  node_comparepage["Compare page<br/>[compare.html]"]
  node_download["Download route<br/>[app.py]"]
  node_uploads[("Image uploads<br/>[app.py]")]
  node_encodedfiles[("Encoded images<br/>[app.py]")]
  node_decodedfile[("Decoded text<br/>[app.py]")]
end

subgraph group_stego["Steganography"]
  node_lsb["LSB encoding<br/>[watermarking.py]"]
  node_dct["DCT encoding<br/>[watermarking.py]"]
end

subgraph group_quality["Image comparison"]
  node_comparisonfile[("Comparison report<br/>[app.py]")]
  node_compare["Quality metrics<br/>[watermarking.py]"]
end

subgraph group_cli["Command line"]
  node_cli["Interactive workflow<br/>[watermarking.py]"]
end

node_user(("User"))

node_user -->|"opens"| node_home
node_webapp -->|"renders"| node_home
node_webapp -->|"renders"| node_encodepage
node_webapp -->|"renders"| node_decodepage
node_webapp -->|"renders"| node_comparepage
node_user -->|"submits"| node_webapp
node_webapp -->|"writes"| node_uploads
node_webapp -->|"encodes or decodes"| node_lsb
node_webapp -->|"encodes or decodes"| node_dct
node_webapp -->|"writes"| node_encodedfiles
node_webapp -->|"writes"| node_decodedfile
node_webapp -->|"calculates metrics"| node_compare
node_webapp -->|"writes report"| node_comparisonfile
node_webapp -->|"routes downloads"| node_download
node_download -->|"reads"| node_encodedfiles
node_download -->|"reads"| node_decodedfile
node_download -->|"reads"| node_comparisonfile
node_cli -->|"calls"| node_lsb
node_cli -->|"calls"| node_dct
node_cli -->|"calls"| node_compare

click node_home "https://github.com/vamshi-mohan/image_steganography/blob/main/templates/index.html"
click node_webapp "https://github.com/vamshi-mohan/image_steganography/blob/main/app.py"
click node_encodepage "https://github.com/vamshi-mohan/image_steganography/blob/main/templates/encode.html"
click node_decodepage "https://github.com/vamshi-mohan/image_steganography/blob/main/templates/decode.html"
click node_comparepage "https://github.com/vamshi-mohan/image_steganography/blob/main/templates/compare.html"
click node_download "https://github.com/vamshi-mohan/image_steganography/blob/main/app.py"
click node_uploads "https://github.com/vamshi-mohan/image_steganography/blob/main/app.py"
click node_encodedfiles "https://github.com/vamshi-mohan/image_steganography/blob/main/app.py"
click node_decodedfile "https://github.com/vamshi-mohan/image_steganography/blob/main/app.py"
click node_comparisonfile "https://github.com/vamshi-mohan/image_steganography/blob/main/app.py"
click node_lsb "https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.py"
click node_dct "https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.py"
click node_compare "https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.py"
click node_cli "https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.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_home,node_webapp,node_encodepage,node_decodepage,node_comparepage,node_download,node_uploads,node_encodedfiles,node_decodedfile,node_user toneBlue
class node_lsb,node_dct toneAmber
class node_comparisonfile,node_compare toneMint
class node_cli toneRose
```

## Components

### Web interface

- [Home page](https://github.com/vamshi-mohan/image_steganography/blob/main/templates/index.html): `templates/index.html`
- [Web routes](https://github.com/vamshi-mohan/image_steganography/blob/main/app.py): `app.py`
- [Encode page](https://github.com/vamshi-mohan/image_steganography/blob/main/templates/encode.html): `templates/encode.html`
- [Decode page](https://github.com/vamshi-mohan/image_steganography/blob/main/templates/decode.html): `templates/decode.html`
- [Compare page](https://github.com/vamshi-mohan/image_steganography/blob/main/templates/compare.html): `templates/compare.html`
- [Download route](https://github.com/vamshi-mohan/image_steganography/blob/main/app.py): `app.py`
- [Image uploads](https://github.com/vamshi-mohan/image_steganography/blob/main/app.py): `app.py`
- [Encoded images](https://github.com/vamshi-mohan/image_steganography/blob/main/app.py): `app.py`
- [Decoded text](https://github.com/vamshi-mohan/image_steganography/blob/main/app.py): `app.py`

### Steganography

- [LSB encoding](https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.py): `watermarking.py`
- [DCT encoding](https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.py): `watermarking.py`

### Image comparison

- [Comparison report](https://github.com/vamshi-mohan/image_steganography/blob/main/app.py): `app.py`
- [Quality metrics](https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.py): `watermarking.py`

### Command line

- [Interactive workflow](https://github.com/vamshi-mohan/image_steganography/blob/main/watermarking.py): `watermarking.py`

### Other components

- **User**

## Connections

- User → Home page: opens
- Web routes → Home page: renders (evidence: `app.py`)
- Web routes → Encode page: renders (evidence: `app.py`)
- Web routes → Decode page: renders (evidence: `app.py`)
- Web routes → Compare page: renders (evidence: `app.py`)
- User → Web routes: submits (evidence: `app.py`)
- Web routes → Image uploads: writes (evidence: `app.py`)
- Web routes → LSB encoding: encodes or decodes (evidence: `app.py`)
- Web routes → DCT encoding: encodes or decodes (evidence: `app.py`)
- Web routes → Encoded images: writes (evidence: `app.py`)
- Web routes → Decoded text: writes (evidence: `app.py`)
- Web routes → Quality metrics: calculates metrics (evidence: `app.py`)
- Web routes → Comparison report: writes report (evidence: `app.py`)
- Web routes → Download route: routes downloads (evidence: `app.py`)
- Download route → Encoded images: reads (evidence: `app.py`)
- Download route → Decoded text: reads (evidence: `app.py`)
- Download route → Comparison report: reads (evidence: `app.py`)
- Interactive workflow → LSB encoding: calls (evidence: `watermarking.py`)
- Interactive workflow → DCT encoding: calls (evidence: `watermarking.py`)
- Interactive workflow → Quality metrics: calls (evidence: `watermarking.py`)
