# raphaelle-lemaire/stenographysimpleexercise architecture

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

- Interactive diagram: https://gitdiagram.com/raphaelle-lemaire/stenographysimpleexercise
- Repository: https://github.com/raphaelle-lemaire/stenographysimpleexercise

## Overview

This small Python script hides ASCII text in an RGB image by changing pixel-value parity, then retrieves it by scanning the image for a 16-bit delimiter. The main workflows are encoding (open and size the image, convert and validate the message, embed bits, save) and decoding (open and size the image, extract bits, reconstruct text). The graph reflects calls visible in the sole source file; image files are external inputs and outputs.

Main entry points: [`PutTextInImage/code.py`](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py) (Encode Message)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_encoding["Encoding"]
  node_encode["Encode Message<br/>[code.py]"]
  node_text_bits["Text to Bits<br/>[code.py]"]
  node_capacity["Capacity Check<br/>[code.py]"]
  node_embed["Embed RGB Bits<br/>[code.py]"]
end

subgraph group_decoding["Decoding"]
  node_decode["Decode Message<br/>[code.py]"]
  node_extract["Extract RGB Bits<br/>[code.py]"]
  node_bits_text["Bits to Text<br/>[code.py]"]
end

subgraph group_image_ops["Image Operations"]
  node_open_image["Open Image<br/>[code.py]"]
  node_image_size["Read Dimensions<br/>[code.py]"]
  node_save_image["Save Image<br/>[code.py]"]
end

node_user(("User"))
node_input_image["Input Image"]
node_output_image["Encoded Image"]
node_encoded_text["Hidden Text"]

node_user -->|"requests encoding"| node_encode
node_user -->|"requests decoding"| node_decode
node_input_image -->|"image input"| node_open_image
node_encode -->|"opens image"| node_open_image
node_encode -->|"reads dimensions"| node_image_size
node_encode -->|"converts text"| node_text_bits
node_encode -->|"checks capacity"| node_capacity
node_encode -->|"embeds bits"| node_embed
node_embed -->|"saves image"| node_save_image
node_save_image -->|"writes image"| node_output_image
node_output_image -->|"image input"| node_open_image
node_decode -->|"opens image"| node_open_image
node_decode -->|"reads dimensions"| node_image_size
node_decode -->|"extracts bits"| node_extract
node_extract -->|"reconstructs text"| node_bits_text
node_extract -->|"prints message"| node_encoded_text

click node_encode "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_text_bits "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_capacity "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_embed "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_decode "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_extract "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_bits_text "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_open_image "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_image_size "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py"
click node_save_image "https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.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_encode,node_text_bits,node_capacity,node_embed,node_user toneBlue
class node_decode,node_extract,node_bits_text toneAmber
class node_open_image,node_image_size,node_save_image toneMint
class node_input_image,node_output_image,node_encoded_text toneIndigo
```

## Components

### Encoding

- [Encode Message](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`
- [Text to Bits](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`
- [Capacity Check](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`
- [Embed RGB Bits](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`

### Decoding

- [Decode Message](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`
- [Extract RGB Bits](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`
- [Bits to Text](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`

### Image Operations

- [Open Image](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`
- [Read Dimensions](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`
- [Save Image](https://github.com/raphaelle-lemaire/stenographysimpleexercise/blob/main/PutTextInImage/code.py): `PutTextInImage/code.py`

### Other components

- **User**
- **Input Image**
- **Encoded Image**
- **Hidden Text**

## Connections

- User → Encode Message: requests encoding (evidence: `README.md`)
- User → Decode Message: requests decoding (evidence: `README.md`)
- Input Image → Open Image: image input (evidence: `PutTextInImage/code.py`)
- Encode Message → Open Image: opens image (evidence: `PutTextInImage/code.py`)
- Encode Message → Read Dimensions: reads dimensions (evidence: `PutTextInImage/code.py`)
- Encode Message → Text to Bits: converts text (evidence: `PutTextInImage/code.py`)
- Encode Message → Capacity Check: checks capacity (evidence: `PutTextInImage/code.py`)
- Encode Message → Embed RGB Bits: embeds bits (evidence: `PutTextInImage/code.py`)
- Embed RGB Bits → Save Image: saves image (evidence: `PutTextInImage/code.py`)
- Save Image → Encoded Image: writes image (evidence: `PutTextInImage/code.py`)
- Encoded Image → Open Image: image input (evidence: `README.md`)
- Decode Message → Open Image: opens image (evidence: `PutTextInImage/code.py`)
- Decode Message → Read Dimensions: reads dimensions (evidence: `PutTextInImage/code.py`)
- Decode Message → Extract RGB Bits: extracts bits (evidence: `PutTextInImage/code.py`)
- Extract RGB Bits → Bits to Text: reconstructs text (evidence: `PutTextInImage/code.py`)
- Extract RGB Bits → Hidden Text: prints message (evidence: `PutTextInImage/code.py`)
