# akazdayo/pixelart architecture

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

- Interactive diagram: https://gitdiagram.com/akazdayo/pixelart
- Repository: https://github.com/akazdayo/pixelart

## Overview

##### Frontend Layer (Streamlit Application)
- Main components:
- Main Page (main.py)
- How to Use Page (pages/how_to_use.py)

##### Core Processing Layer
- Key modules:
- Filters Module (src/filters.py) - Anime filter and effects
- Run Module (src/run.py) - Process orchestration

##### Data Resources
- At the bottom or side
- Standard Palettes (cold, gold, pale, pastel, pyxel, rainbow, warm)
- Custom Palette Support
- AI-Generated Palette

##### External Dependencies
- Rust Module Integration (pixelart-modules)
- Streamlit Platform

##### Component Relationships
- User Interface → Core Processing → Data Resources
- ↑                  ↓              ↑
- Result Flow ───────────┘

Key Flows to Highlight:

##### Filter Application Flow
- Anime Filter Options → Filters Module → Image Processing Pipeline

Special Considerations:

##### Experimental AI features with a distinct marking

- Special markers for experimental features

Level of Detail:
- AI palette generation process
- Filter application workflow

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef frontend fill:#FFB6C1,stroke:#333
    classDef processing fill:#98FB98,stroke:#333
    classDef data fill:#FFC0CB,stroke:#333
    classDef external fill:#E6E6FA,stroke:#333
    classDef experimental stroke-dasharray: 5 5

    %% Frontend Layer
    subgraph Frontend
        MainUI["🎨 Main Interface"]
        ColorSampleUI["🎨 Color Sample Page"]
        HowToUseUI["📖 How To Use Page"]
    end
    class MainUI,ColorSampleUI,HowToUseUI frontend

    %% Processing Layer
    subgraph Processing
        AI["🤖 AI Module<br/>(KMeans Palette)"]:::experimental
        Convert["🔄 Color Conversion<br/>Module"]
        Draw["✏️ Image Drawing<br/>Module"]
        Filters["✨ Image Filters<br/>Module"]
        Run["⚙️ Process<br/>Orchestrator"]
    end
    class AI,Convert,Draw,Filters,Run processing

    %% Data Resources
    subgraph ColorPalettes["🎨 Color Palettes"]
        direction TB
        Standard["📚 Standard Palettes"]
        Custom["🎯 Custom Palettes"]
        AIGen["🌟 AI Generated<br/>Palettes"]:::experimental
        
        subgraph StandardPalettes
            Cold["❄️ Cold"]
            Gold["💫 Gold"]
            Pale["🌸 Pale"]
            Pastel["🍭 Pastel"]
            Pyxel["🎮 Pyxel"]
            Rainbow["🌈 Rainbow"]
            Warm["🔥 Warm"]
        end
    end
    class Standard,Custom,AIGen,Cold,Gold,Pale,Pastel,Pyxel,Rainbow,Warm data

    %% External Dependencies
    RustModule[("⚡ Rust Module<br/>Integration")]
    StreamlitPlatform[("🚀 Streamlit<br/>Platform")]
    class RustModule,StreamlitPlatform external

    %% Relationships
    MainUI --> Run
    ColorSampleUI --> Convert
    HowToUseUI --> MainUI
    
    Run --> AI
    Run --> Convert
    Run --> Draw
    Run --> Filters
    
    AI --> AIGen
    Convert --> Standard
    Convert --> Custom
    Convert --> AIGen
    
    Standard --> StandardPalettes
    
    RustModule --> Convert
    StreamlitPlatform --> Frontend

    %% Click Events
    click MainUI "https://github.com/akazdayo/pixelart/blob/main/main.py"
    click ColorSampleUI "https://github.com/akazdayo/pixelart/blob/main/pages/color_sample.py"
    click HowToUseUI "https://github.com/akazdayo/pixelart/blob/main/pages/how_to_use.py"
    click AI "https://github.com/akazdayo/pixelart/blob/main/src/ai.py"
    click Convert "https://github.com/akazdayo/pixelart/blob/main/src/convert.py"
    click Draw "https://github.com/akazdayo/pixelart/blob/main/src/draw.py"
    click Filters "https://github.com/akazdayo/pixelart/blob/main/src/filters.py"
    click Run "https://github.com/akazdayo/pixelart/blob/main/src/run.py"
    click Cold "https://github.com/akazdayo/pixelart/blob/main/color/cold.csv"
    click Gold "https://github.com/akazdayo/pixelart/blob/main/color/gold.csv"
    click Pale "https://github.com/akazdayo/pixelart/blob/main/color/pale.csv"
    click Pastel "https://github.com/akazdayo/pixelart/blob/main/color/pastel.csv"
    click Pyxel "https://github.com/akazdayo/pixelart/blob/main/color/pyxel.csv"
    click Rainbow "https://github.com/akazdayo/pixelart/blob/main/color/rainbow.csv"
    click Warm "https://github.com/akazdayo/pixelart/blob/main/color/warm.csv"
    click StreamlitPlatform "https://github.com/akazdayo/pixelart/blob/main/.streamlit/config.toml"
    click Standard "https://github.com/akazdayo/pixelart/tree/main/color/"

    %% Legend
    subgraph Legend
        Frontend_L["🎨 Frontend Component"]:::frontend
        Processing_L["⚙️ Processing Component"]:::processing
        Data_L["📚 Data Resource"]:::data
        External_L["🔌 External Dependency"]:::external
        Experimental_L["🧪 Experimental Feature"]:::experimental
    end
```
