# tymurshashok/image2ascii architecture

> Architecture diagram of the GitHub repository tymurshashok/image2ascii, 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/tymurshashok/image2ascii
- Repository: https://github.com/tymurshashok/image2ascii

## Overview

Image2ASCII is a Windows console application that loads an image, resizes it, converts each pixel’s brightness to a character, and prints and saves the result. The main workflow is visible in the excerpts; the README also documents three symbol sets and monochrome or RGB output. The graph separates rendering from pixel conversion and brightness calculation. The source uses `image.jpg`; the README’s setup section instead says `image1.jpg`.

Main entry points: [`Renderer.cpp`](https://github.com/tymurshashok/image2ascii/blob/main/Renderer.cpp) (Image renderer), [`ASCII_ART_.cpp`](https://github.com/tymurshashok/image2ascii/blob/main/ASCII_ART_.cpp) (Application entry), [`ASCIIConverter.cpp`](https://github.com/tymurshashok/image2ascii/blob/main/ASCIIConverter.cpp) (ASCII converter), [`Pixel.h`](https://github.com/tymurshashok/image2ascii/blob/main/Pixel.h) (Pixel brightness)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_entry["Application entry<br/>[ASCII_ART_.cpp]"]
  node_input["Input image"]
  node_opencv["OpenCV"]
end

subgraph group_conversion["Pixel conversion"]
  node_converter["ASCII converter<br/>[ASCIIConverter.cpp]"]
  node_pixel["Pixel brightness<br/>[Pixel.h]"]
end

subgraph group_outputs["Output"]
  node_renderer["Image renderer<br/>[Renderer.cpp]"]
  node_console["Console output"]
  node_result["Text output<br/>[image.txt]"]
end

node_user(("User"))

node_user -->|"runs"| node_entry
node_input -->|"loads"| node_entry
node_entry -->|"reads image"| node_opencv
node_entry -->|"starts rendering"| node_renderer
node_renderer -->|"resizes image"| node_opencv
node_renderer -->|"maps pixels"| node_converter
node_converter -->|"gets brightness"| node_pixel
node_renderer -->|"prints characters"| node_console
node_renderer -->|"writes text"| node_result

click node_entry "https://github.com/tymurshashok/image2ascii/blob/main/ASCII_ART_.cpp"
click node_renderer "https://github.com/tymurshashok/image2ascii/blob/main/Renderer.cpp"
click node_converter "https://github.com/tymurshashok/image2ascii/blob/main/ASCIIConverter.cpp"
click node_pixel "https://github.com/tymurshashok/image2ascii/blob/main/Pixel.h"
click node_result "https://github.com/tymurshashok/image2ascii/blob/main/image.txt"

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_entry,node_input,node_opencv,node_user toneBlue
class node_converter,node_pixel toneAmber
class node_renderer,node_console,node_result toneMint
```

## Components

### Application flow

- [Application entry](https://github.com/tymurshashok/image2ascii/blob/main/ASCII_ART_.cpp): `ASCII_ART_.cpp`
- **Input image**
- **OpenCV**

### Pixel conversion

- [ASCII converter](https://github.com/tymurshashok/image2ascii/blob/main/ASCIIConverter.cpp): `ASCIIConverter.cpp`
- [Pixel brightness](https://github.com/tymurshashok/image2ascii/blob/main/Pixel.h): `Pixel.h`

### Output

- [Image renderer](https://github.com/tymurshashok/image2ascii/blob/main/Renderer.cpp): `Renderer.cpp`
- **Console output**
- [Text output](https://github.com/tymurshashok/image2ascii/blob/main/image.txt): `image.txt`

### Other components

- **User**

## Connections

- User → Application entry: runs (evidence: `README.md`)
- Input image → Application entry: loads (evidence: `ASCII_ART_.cpp`)
- Application entry → OpenCV: reads image (evidence: `ASCII_ART_.cpp`)
- Application entry → Image renderer: starts rendering (evidence: `ASCII_ART_.cpp`)
- Image renderer → OpenCV: resizes image (evidence: `Renderer.cpp`)
- Image renderer → ASCII converter: maps pixels (evidence: `Renderer.cpp`)
- ASCII converter → Pixel brightness: gets brightness (evidence: `ASCIIConverter.cpp`)
- Image renderer → Console output: prints characters (evidence: `Renderer.cpp`)
- Image renderer → Text output: writes text (evidence: `Renderer.cpp`)
