# md-mushfiqur123/mif-image-format architecture

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

- Interactive diagram: https://gitdiagram.com/md-mushfiqur123/mif-image-format
- Repository: https://github.com/md-mushfiqur123/mif-image-format

## Overview

MIF is a lossless image format with Python and C reference codecs. The primary workflow is to encode a standard image into MIF, then decode it back with CRC-32 integrity checking; the CLI exposes encode, decode, and metadata inspection. The v2 Python engine also powers the GUI studio and Windows thumbnail handler. The README documents additional codec capabilities, including spatial predictors and reversible color transforms. Edges are limited to calls visible in excerpts or relationships stated in the README; the sampled code does not show internal v2 processing calls.

Main entry points: [`mif_cli.py`](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_cli.py) (CLI converter), [`mif_studio.py`](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_studio.py) (GUI studio), [`mif_thumbnail_handler.py`](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_thumbnail_handler.py) (Thumbnail handler), [`mif_engine_v2.py`](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_engine_v2.py) (Python v2 engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_codec["Codec implementations"]
  node_python_v1["Python v1 codec<br/>[mif_codec.py]"]
  node_python_v2["Python v2 engine<br/>[mif_engine_v2.py]"]
  node_c_codec["C reference codec<br/>[libmif.h]"]
end

subgraph group_tools["User tools"]
  node_cli["CLI converter<br/>[mif_cli.py]"]
  node_studio["GUI studio<br/>[mif_studio.py]"]
end

subgraph group_integration["Shell integration"]
  node_thumbnail["Thumbnail handler"]
  node_registry["Shell registration"]
end

node_user(("Image user"))
node_image["Image files"]
node_mif_file["MIF files"]
node_windows(("Windows Explorer"))

node_user -->|"runs commands"| node_cli
node_cli -->|"calls codec"| node_python_v1
node_image -->|"provides input"| node_cli
node_cli -->|"writes output"| node_mif_file
node_mif_file -->|"provides input"| node_cli
node_cli -->|"writes output"| node_image
node_user -->|"opens studio"| node_studio
node_studio -->|"calls engine"| node_python_v2
node_user -->|"integrates library"| node_c_codec
node_windows -.->|"requests preview"| node_thumbnail
node_thumbnail -->|"decodes image"| node_python_v2
node_registry -->|"registers association"| node_windows

click node_python_v1 "https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_codec.py"
click node_python_v2 "https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_engine_v2.py"
click node_c_codec "https://github.com/md-mushfiqur123/mif-image-format/blob/main/libmif.h"
click node_cli "https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_cli.py"
click node_studio "https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_studio.py"
click node_thumbnail "https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_thumbnail_handler.py"
click node_registry "https://github.com/md-mushfiqur123/mif-image-format/blob/main/register_mif_os.reg"

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_python_v1,node_python_v2,node_c_codec,node_user toneBlue
class node_cli,node_studio toneAmber
class node_thumbnail,node_registry toneMint
class node_image,node_mif_file,node_windows toneIndigo
```

## Components

### Codec implementations

- [Python v1 codec](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_codec.py): `mif_codec.py`
- [Python v2 engine](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_engine_v2.py): `mif_engine_v2.py`
- [C reference codec](https://github.com/md-mushfiqur123/mif-image-format/blob/main/libmif.h): `libmif.h`

### User tools

- [CLI converter](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_cli.py): `mif_cli.py`
- [GUI studio](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_studio.py): `mif_studio.py`

### Shell integration

- [Thumbnail handler](https://github.com/md-mushfiqur123/mif-image-format/blob/main/mif_thumbnail_handler.py): `mif_thumbnail_handler.py`
- [Shell registration](https://github.com/md-mushfiqur123/mif-image-format/blob/main/register_mif_os.reg): `register_mif_os.reg`

### Other components

- **Image user**
- **Image files**
- **MIF files**
- **Windows Explorer**

## Connections

- Image user → CLI converter: runs commands (evidence: `README.md`)
- CLI converter → Python v1 codec: calls codec (evidence: `mif_cli.py`)
- Image files → CLI converter: provides input (evidence: `README.md`)
- CLI converter → MIF files: writes output (evidence: `README.md`)
- MIF files → CLI converter: provides input (evidence: `README.md`)
- CLI converter → Image files: writes output (evidence: `README.md`)
- Image user → GUI studio: opens studio (evidence: `README.md`)
- GUI studio → Python v2 engine: calls engine (evidence: `mif_studio.py`)
- Image user → C reference codec: integrates library (evidence: `README.md`)
- Windows Explorer → Thumbnail handler: requests preview
- Thumbnail handler → Python v2 engine: decodes image (evidence: `mif_thumbnail_handler.py`)
- Shell registration → Windows Explorer: registers association (evidence: `README.md`)
