# paritosh264/image-to-ascii architecture

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

- Interactive diagram: https://gitdiagram.com/paritosh264/image-to-ascii
- Repository: https://github.com/paritosh264/image-to-ascii

## Overview

This small Java CLI reads an image, scales it to the requested console width, and converts its pixels into colored ASCII characters printed to the terminal. The main method owns image loading, sizing, and conversion; the conversion method calculates grayscale brightness and delegates character selection and colored printing to gray_ascii. The source excerpt supports these calls directly. Sample command files are not runtime components.

Main entry points: [`img_asci.java`](https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java) (CLI entry point)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("CLI user"))
node_main["CLI entry point<br/>[img_asci.java]"]
node_reader["Image reader<br/>[img_asci.java]"]
node_scaler["Image scaler<br/>[img_asci.java]"]
node_converter["Pixel converter<br/>[img_asci.java]"]
node_mapper["ASCII color mapper<br/>[img_asci.java]"]
node_terminal(("Terminal output"))

node_user -->|"runs"| node_main
node_main -->|"reads image"| node_reader
node_main -->|"scales image"| node_scaler
node_main -->|"converts image"| node_converter
node_converter -->|"maps pixels"| node_mapper
node_main -->|"prints status"| node_terminal
node_converter -->|"prints rows"| node_terminal
node_mapper -->|"prints characters"| node_terminal

click node_main "https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java"
click node_reader "https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java"
click node_scaler "https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java"
click node_converter "https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java"
click node_mapper "https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java"

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_user toneBlue
class node_main,node_reader,node_scaler,node_converter,node_mapper toneTeal
class node_terminal toneIndigo
```

## Components

### Other components

- **CLI user**
- [CLI entry point](https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java): `img_asci.java`
- [Image reader](https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java): `img_asci.java`
- [Image scaler](https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java): `img_asci.java`
- [Pixel converter](https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java): `img_asci.java`
- [ASCII color mapper](https://github.com/paritosh264/image-to-ascii/blob/main/img_asci.java): `img_asci.java`
- **Terminal output**

## Connections

- CLI user → CLI entry point: runs (evidence: `README.md`)
- CLI entry point → Image reader: reads image (evidence: `img_asci.java`)
- CLI entry point → Image scaler: scales image (evidence: `img_asci.java`)
- CLI entry point → Pixel converter: converts image (evidence: `img_asci.java`)
- Pixel converter → ASCII color mapper: maps pixels (evidence: `img_asci.java`)
- CLI entry point → Terminal output: prints status (evidence: `img_asci.java`)
- Pixel converter → Terminal output: prints rows (evidence: `img_asci.java`)
- ASCII color mapper → Terminal output: prints characters (evidence: `img_asci.java`)
