# ouffata-ishak/image2ascii architecture

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

- Interactive diagram: https://gitdiagram.com/ouffata-ishak/image2ascii
- Repository: https://github.com/ouffata-ishak/image2ascii

## Overview

Image to ASCII is a command-line image converter. Its main workflow parses size and saliency options, validates the input path and extension, loads and resizes pixels, then converts them to ASCII and prints the result. The graph separates input validation, image processing, and ASCII rendering, with file-level helper layers shown where calls are supported. README capabilities cover the documented formats, size presets/custom line length, and saliency option. Relationships are based on sampled source and README; no unsampled implementation links are assumed.

Main entry points: [`src/main.c`](https://github.com/ouffata-ishak/image2ascii/blob/main/src/main.c) (CLI workflow), [`src/stb_impl.c`](https://github.com/ouffata-ishak/image2ascii/blob/main/src/stb_impl.c) (Image loader), [`src/file_utils.c`](https://github.com/ouffata-ishak/image2ascii/blob/main/src/file_utils.c) (Path and format checks), [`include/stb_impl.h`](https://github.com/ouffata-ishak/image2ascii/blob/main/include/stb_impl.h) (Image API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command Line"]
  node_entry["CLI workflow<br/>[main.c]"]
end

subgraph group_input["Input Handling"]
  node_validation["Path and format checks<br/>[file_utils.c]"]
  node_filehelpers["File helpers<br/>[file_utils.h]"]
end

subgraph group_pixels["Image Processing"]
  node_loader["Image loader<br/>[stb_impl.c]"]
  node_decoder["Format decoders<br/>[stb_image.h]"]
  node_resizer["Image resize"]
  node_imageapi["Image API<br/>[stb_impl.h]"]
end

subgraph group_render["ASCII Rendering"]
  node_renderapi["Render API<br/>[utils.h]"]
  node_converter["ASCII conversion<br/>[utils.c]"]
end

node_user(("CLI user"))

node_user -->|"runs with options"| node_entry
node_entry -->|"checks input"| node_validation
node_entry -->|"uses helpers"| node_filehelpers
node_validation -->|"implements"| node_filehelpers
node_entry -->|"loads and resizes"| node_imageapi
node_imageapi -->|"declares API"| node_loader
node_loader -->|"decodes image"| node_decoder
node_loader -->|"resizes pixels"| node_resizer
node_entry -->|"calls conversion"| node_renderapi
node_entry -->|"prints result"| node_converter
node_converter -->|"implements API"| node_renderapi

click node_entry "https://github.com/ouffata-ishak/image2ascii/blob/main/src/main.c"
click node_validation "https://github.com/ouffata-ishak/image2ascii/blob/main/src/file_utils.c"
click node_filehelpers "https://github.com/ouffata-ishak/image2ascii/blob/main/include/file_utils.h"
click node_loader "https://github.com/ouffata-ishak/image2ascii/blob/main/src/stb_impl.c"
click node_decoder "https://github.com/ouffata-ishak/image2ascii/blob/main/include/stb_image.h"
click node_resizer "https://github.com/ouffata-ishak/image2ascii/blob/main/include/stb_image_resize2.h"
click node_imageapi "https://github.com/ouffata-ishak/image2ascii/blob/main/include/stb_impl.h"
click node_renderapi "https://github.com/ouffata-ishak/image2ascii/blob/main/include/utils.h"
click node_converter "https://github.com/ouffata-ishak/image2ascii/blob/main/src/utils.c"

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_user toneBlue
class node_validation,node_filehelpers toneAmber
class node_loader,node_decoder,node_resizer,node_imageapi toneMint
class node_renderapi,node_converter toneRose
```

## Components

### Command Line

- [CLI workflow](https://github.com/ouffata-ishak/image2ascii/blob/main/src/main.c): `src/main.c`

### Input Handling

- [Path and format checks](https://github.com/ouffata-ishak/image2ascii/blob/main/src/file_utils.c): `src/file_utils.c`
- [File helpers](https://github.com/ouffata-ishak/image2ascii/blob/main/include/file_utils.h): `include/file_utils.h`

### Image Processing

- [Image loader](https://github.com/ouffata-ishak/image2ascii/blob/main/src/stb_impl.c): `src/stb_impl.c`
- [Format decoders](https://github.com/ouffata-ishak/image2ascii/blob/main/include/stb_image.h): `include/stb_image.h`
- [Image resize](https://github.com/ouffata-ishak/image2ascii/blob/main/include/stb_image_resize2.h): `include/stb_image_resize2.h`
- [Image API](https://github.com/ouffata-ishak/image2ascii/blob/main/include/stb_impl.h): `include/stb_impl.h`

### ASCII Rendering

- [Render API](https://github.com/ouffata-ishak/image2ascii/blob/main/include/utils.h): `include/utils.h`
- [ASCII conversion](https://github.com/ouffata-ishak/image2ascii/blob/main/src/utils.c): `src/utils.c`

### Other components

- **CLI user**

## Connections

- CLI user → CLI workflow: runs with options (evidence: `README.md`)
- CLI workflow → Path and format checks: checks input (evidence: `src/main.c`)
- CLI workflow → File helpers: uses helpers (evidence: `src/main.c`)
- Path and format checks → File helpers: implements (evidence: `src/file_utils.c`)
- CLI workflow → Image API: loads and resizes (evidence: `src/main.c`)
- Image API → Image loader: declares API (evidence: `include/stb_impl.h`)
- Image loader → Format decoders: decodes image (evidence: `src/stb_impl.c`)
- Image loader → Image resize: resizes pixels (evidence: `src/stb_impl.c`)
- CLI workflow → Render API: calls conversion (evidence: `src/main.c`)
- CLI workflow → ASCII conversion: prints result (evidence: `src/main.c`)
- ASCII conversion → Render API: implements API (evidence: `src/utils.c`)
