# meguminbot/textureatlas-toolbox architecture

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

- Interactive diagram: https://gitdiagram.com/meguminbot/textureatlas-toolbox
- Repository: https://github.com/meguminbot/textureatlas-toolbox

## Overview

TextureAtlas Toolbox is a desktop application for extracting sprites and animations, generating and converting atlases, optimizing images, and editing animation alignment. The main user workflow runs through the GUI: choose an operation, configure inputs and options, then process and export results. Extraction parses atlas metadata and produces frames or animations; generation packs frames and writes atlas formats. The README documents these capabilities, while sampled source confirms the application setup, frame preparation, and exporter registration. Some internal processing links are omitted where the excerpts do not show their callers.

Main entry points: [`src/Main.py`](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/Main.py) (Main application), [`src/core/extractor/extractor.py`](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/extractor.py) (Extraction orchestrator), [`src/core/generator/atlas_generator.py`](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/generator/atlas_generator.py) (Atlas generation), [`src/gui/extract_tab_widget.py`](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/extract_tab_widget.py) (Extract controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and editing"]
  node_main["Main application<br/>[Main.py]"]
  node_extract_ui["Extract controls"]
  node_generate_ui["Generate controls"]
  node_optimize_ui["Optimize controls"]
  node_editor_ui["Alignment editor"]
  node_editor_core["Composite editing"]
end

subgraph group_extract["Atlas extraction"]
  node_extractor["Extraction orchestrator<br/>[extractor.py]"]
  node_atlas_processor["Atlas processing<br/>[atlas_processor.py]"]
  node_parser["Format parsers"]
  node_sprite_processor["Sprite grouping"]
  node_frame_pipeline["Frame preparation<br/>[frame_pipeline.py]"]
  node_animation_export["Animation export"]
  node_preview["Animation preview"]
end

subgraph group_generate["Atlas generation"]
  node_generator["Atlas generation<br/>[atlas_generator.py]"]
  node_packers["Packing algorithms"]
end

subgraph group_formats["Formats and optimization"]
  node_export_registry["Format exporter registry"]
  node_exporters["Atlas format exporters"]
  node_optimizer["Image optimizer<br/>[optimizer.py]"]
  node_texture_compress["GPU compression"]
end

node_user(("User"))

node_user -->|"uses"| node_main
node_main -->|"sets up"| node_extract_ui
node_main -->|"sets up"| node_generate_ui
node_main -->|"sets up"| node_editor_ui
node_main -.->|"sets up"| node_optimize_ui
node_user -->|"configures extraction"| node_extract_ui
node_extract_ui -.->|"starts processing"| node_extractor
node_extractor -.->|"processes atlases"| node_atlas_processor
node_atlas_processor -.->|"reads metadata"| node_parser
node_extractor -.->|"groups sprites"| node_sprite_processor
node_extractor -.->|"prepares frames"| node_frame_pipeline
node_frame_pipeline -.->|"provides frames"| node_animation_export
node_user -->|"previews animations"| node_preview
node_user -->|"configures generation"| node_generate_ui
node_generate_ui -.->|"generates atlas"| node_generator
node_generator -->|"packs sprites"| node_packers
node_generator -->|"selects exporter"| node_export_registry
node_export_registry -->|"registers formats"| node_exporters
node_user -->|"configures optimization"| node_optimize_ui
node_optimize_ui -.->|"optimizes images"| node_optimizer
node_optimizer -.->|"compresses textures"| node_texture_compress
node_user -->|"edits alignment"| node_editor_ui
node_editor_ui -->|"edits composites"| node_editor_core

click node_main "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/Main.py"
click node_extract_ui "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/extract_tab_widget.py"
click node_generate_ui "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/generate_tab_widget.py"
click node_optimize_ui "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/optimize_tab_widget.py"
click node_editor_ui "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/editor_tab_widget.py"
click node_editor_core "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/editor/editor_composite.py"
click node_extractor "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/extractor.py"
click node_atlas_processor "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/atlas_processor.py"
click node_parser "https://github.com/meguminbot/textureatlas-toolbox/tree/main/src/parsers"
click node_sprite_processor "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/sprite_processor.py"
click node_frame_pipeline "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/frame_pipeline.py"
click node_animation_export "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/animation_exporter.py"
click node_preview "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/preview_generator.py"
click node_generator "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/generator/atlas_generator.py"
click node_packers "https://github.com/meguminbot/textureatlas-toolbox/tree/main/src/packers"
click node_export_registry "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/exporters/exporter_registry.py"
click node_exporters "https://github.com/meguminbot/textureatlas-toolbox/tree/main/src/exporters"
click node_optimizer "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/optimizer/optimizer.py"
click node_texture_compress "https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/optimizer/texture_compress.py"

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_main,node_extract_ui,node_generate_ui,node_optimize_ui,node_editor_ui,node_editor_core,node_user toneBlue
class node_extractor,node_atlas_processor,node_parser,node_sprite_processor,node_frame_pipeline,node_animation_export,node_preview toneAmber
class node_generator,node_packers toneMint
class node_export_registry,node_exporters,node_optimizer,node_texture_compress toneRose
```

## Components

### Application and editing

- [Main application](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/Main.py): `src/Main.py`
- [Extract controls](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/extract_tab_widget.py): `src/gui/extract_tab_widget.py`
- [Generate controls](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/generate_tab_widget.py): `src/gui/generate_tab_widget.py`
- [Optimize controls](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/optimize_tab_widget.py): `src/gui/optimize_tab_widget.py`
- [Alignment editor](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/gui/editor_tab_widget.py): `src/gui/editor_tab_widget.py`
- [Composite editing](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/editor/editor_composite.py): `src/core/editor/editor_composite.py`

### Atlas extraction

- [Extraction orchestrator](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/extractor.py): `src/core/extractor/extractor.py`
- [Atlas processing](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/atlas_processor.py): `src/core/extractor/atlas_processor.py`
- [Format parsers](https://github.com/meguminbot/textureatlas-toolbox/tree/main/src/parsers): `src/parsers`
- [Sprite grouping](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/sprite_processor.py): `src/core/extractor/sprite_processor.py`
- [Frame preparation](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/frame_pipeline.py): `src/core/extractor/frame_pipeline.py`
- [Animation export](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/animation_exporter.py): `src/core/extractor/animation_exporter.py`
- [Animation preview](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/extractor/preview_generator.py): `src/core/extractor/preview_generator.py`

### Atlas generation

- [Atlas generation](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/generator/atlas_generator.py): `src/core/generator/atlas_generator.py`
- [Packing algorithms](https://github.com/meguminbot/textureatlas-toolbox/tree/main/src/packers): `src/packers`

### Formats and optimization

- [Format exporter registry](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/exporters/exporter_registry.py): `src/exporters/exporter_registry.py`
- [Atlas format exporters](https://github.com/meguminbot/textureatlas-toolbox/tree/main/src/exporters): `src/exporters`
- [Image optimizer](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/optimizer/optimizer.py): `src/core/optimizer/optimizer.py`
- [GPU compression](https://github.com/meguminbot/textureatlas-toolbox/blob/main/src/core/optimizer/texture_compress.py): `src/core/optimizer/texture_compress.py`

### Other components

- **User**

## Connections

- User → Main application: uses (evidence: `README.md`)
- Main application → Extract controls: sets up (evidence: `src/Main.py`)
- Main application → Generate controls: sets up (evidence: `src/Main.py`)
- Main application → Alignment editor: sets up (evidence: `src/Main.py`)
- Main application → Optimize controls: sets up (evidence: `README.md`)
- User → Extract controls: configures extraction (evidence: `README.md`)
- Extract controls → Extraction orchestrator: starts processing
- Extraction orchestrator → Atlas processing: processes atlases
- Atlas processing → Format parsers: reads metadata
- Extraction orchestrator → Sprite grouping: groups sprites
- Extraction orchestrator → Frame preparation: prepares frames
- Frame preparation → Animation export: provides frames
- User → Animation preview: previews animations (evidence: `README.md`)
- User → Generate controls: configures generation (evidence: `README.md`)
- Generate controls → Atlas generation: generates atlas
- Atlas generation → Packing algorithms: packs sprites (evidence: `src/core/generator/atlas_generator.py`)
- Atlas generation → Format exporter registry: selects exporter (evidence: `src/core/generator/atlas_generator.py`)
- Format exporter registry → Atlas format exporters: registers formats (evidence: `src/exporters/exporter_registry.py`)
- User → Optimize controls: configures optimization (evidence: `README.md`)
- Optimize controls → Image optimizer: optimizes images
- Image optimizer → GPU compression: compresses textures
- User → Alignment editor: edits alignment (evidence: `README.md`)
- Alignment editor → Composite editing: edits composites (evidence: `src/gui/editor_tab_widget.py`)
