# pfcdx/comicscale architecture

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

- Interactive diagram: https://gitdiagram.com/pfcdx/comicscale
- Repository: https://github.com/pfcdx/comicscale

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        ComicArchives[Comic Archives]:::input
    end

    subgraph "Processing Pipeline"
        direction TB
        Extract["Image Extraction"]:::process
        Upscale["Upscaling Process"]:::process
        Downscale["Downscaling (Optional)"]:::optional
        Reconstruct["Reconstruction"]:::process
    end

    subgraph "External Dependencies"
        direction TB
        UnzipRar["unzip/unrar"]:::dependency
        ImageMagick["ImageMagick"]:::dependency
        RealESRGAN["realesrgan-ncnn-vulkan"]:::dependency
    end

    subgraph "File System States"
        direction TB
        ExtractedDir["Extracted Images Directory"]:::fs
        ProcessedDir["Processed Images Directory"]:::fs
        FinalOutput["Reconstructed Comics"]:::output
    end

    %% Main Process Flow
    ComicArchives --> Extract
    Extract --> ExtractedDir
    ExtractedDir --> Upscale
    Upscale --> ProcessedDir
    ProcessedDir --> Downscale
    Downscale --> Reconstruct
    ProcessedDir --> Reconstruct
    Reconstruct --> FinalOutput

    %% Dependency Connections
    Extract -.-> UnzipRar
    Upscale -.-> RealESRGAN
    Downscale -.-> ImageMagick
    Reconstruct -.-> UnzipRar

    %% Click Events
    click Extract "https://github.com/pfcdx/comicscale/blob/main/scripts/extract-img.sh"
    click Upscale "https://github.com/pfcdx/comicscale/blob/main/scripts/upscale.sh"
    click Downscale "https://github.com/pfcdx/comicscale/blob/main/scripts/downscale.sh"
    click Reconstruct "https://github.com/pfcdx/comicscale/blob/main/scripts/reconstruct.sh"

    %% Styling
    classDef input fill:#90EE90,stroke:#333,stroke-width:2px
    classDef process fill:#ADD8E6,stroke:#333,stroke-width:2px
    classDef optional fill:#FFE4B5,stroke:#333,stroke-width:2px
    classDef dependency fill:#FF9999,stroke:#333,stroke-width:2px
    classDef fs fill:#DCDCDC,stroke:#333,stroke-width:2px
    classDef output fill:#98FB98,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Input"]:::input
        L2["Process"]:::process
        L3["Optional Process"]:::optional
        L4["Dependency"]:::dependency
        L5["File System"]:::fs
        L6["Output"]:::output
    end
```
