Metadata-Version: 2.1
Name: gui-dot-py
Version: 0.1.0
Summary: Cross-platform lightweight library for low-level graphics.
Home-page: https://github.com/unionium/gui-py
Author: Ley
Author-email: ley@unionium.org
Project-URL: Bug Reports, https://github.com/unionium/gui-py/issues
Project-URL: Source, https://github.com/unionium/gui-py
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Pillow (>=9.0.0)
Provides-Extra: termux
Requires-Dist: termuxgui ; extra == 'termux'
Provides-Extra: tk

**Gui.PY** is a cross‑platform lightweight library for low‑level graphics. It supports platforms such as Android, Linux, Windows, macOS, *BSD, and graphics subsystems including GDI, X11, Wayland, SurfaceFlinger, and others.

---

## Features

- **Simple API** – just call `draw()` to display anything.
- **Auto FPS counter** – shows frames per second in the window title.
- **Cross‑platform** – works on desktop and mobile (Android via Termux).
- **Low‑level graphics** – supports multiple backends (GDI, X11, Wayland, SurfaceFlinger, etc.).

---

## Installation

**For desktop (Windows, Linux, macOS, *BSD):**
```bash
pip install gui-py
```

**For Android (Termux with Termux:GUI plugin):**
```bash
pip install gui-py[termux]
```

---

## Quick Start

```python
from gui_py import draw
from PIL import Image

width, height = 400, 400
r, g, b = 255, 0, 0

while True:
    # Create a solid color image
    hex_color = f'#{r:02x}{g:02x}{b:02x}'
    image = Image.new('RGB', (width, height), hex_color)
    
    # Display it – FPS is shown automatically
    draw(image)

    # Smooth color transition (rainbow effect)
    if r == 255 and g < 255 and b == 0:
        g += 1
    elif g == 255 and r > 0 and b == 0:
        r -= 1
    elif g == 255 and b < 255 and r == 0:
        b += 1
    elif b == 255 and g > 0 and r == 0:
        g -= 1
    elif b == 255 and r < 255 and g == 0:
        r += 1
    elif r == 255 and b > 0 and g == 0:
        b -= 1
```

Press `Ctrl+C` to stop the loop.

---

## API

### `draw(image)`

Displays an image in a window with automatic FPS counter.

**Parameters:**
- `image` – a PIL `Image` object or a numpy array (H, W, 3) with dtype uint8.

The window is created automatically on the first call and stays open until the program ends.

---

## Supported Platforms

| Platform          | Installation          | Status    |
|-------------------|-----------------------|-----------|
| Windows           | `pip install gui-py`  | ✅ Full   |
| macOS             | `pip install gui-py`  | ✅ Full   |
| Linux             | `pip install gui-py`  | ✅ Full   |
| *BSD              | `pip install gui-py`  | ✅ Full   |
| Android (Termux)  | `pip install gui-py[termux]` | ✅ Full |

> **Note for Android:** Install [Termux](https://termux.com/) and the [Termux:GUI](https://github.com/termux/termux-gui) plugin first. Then install with the `[termux]` extra to enable the SurfaceFlinger backend.

## License

This project is licensed under the **GNU Affero General Public License v3.0 (AGPL-3.0)**.

You are free to use, modify, and distribute this software, but any modifications or derived works must also be distributed under the same license. If you use this library in a network service (e.g., a web server), you must provide the source code to your users.

See the [LICENSE](LICENSE) file for full details.
