Metadata-Version: 2.4
Name: mineskin
Version: 0.2.1
Summary: Simple Python library to work with Minecraft skins
Author-email: Kiber2009 <92222946+kiber2009@users.noreply.github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/Kiber2009/mineskin
Project-URL: Repository, https://github.com/Kiber2009/mineskin.git
Project-URL: Issues, https://github.com/Kiber2009/mineskin/issues
Keywords: minecraft skin
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: 3.16
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Graphics :: Editors
Classifier: Topic :: Multimedia :: Graphics :: Editors :: Raster-Based
Classifier: Natural Language :: English
Requires-Python: >=3.14
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.4.6
Requires-Dist: pillow>=13.0.0
Dynamic: license-file

# mineskin

Simple Python library to work with Minecraft skins

# Installation

Install `mineskin` from PyPI using your favorite package manager

- `pip install mineskin`
- `uv add mineskin`
- `poetry add mineskin`

# Usage

```python
from PIL import Image

# Import library
import mineskin
from mineskin.skin_types.abc import MinecraftSkinFormat

# Read skin from file
with Image.open("path/to/skin.png") as img:
    img.load()
    
    skin = mineskin.skin(img)
    
    # Check skin information
    print(f"{skin.format=}")
    print(f"{skin.slim=}")
    print(f"{skin.has_overlay=}")

    # Optimize skin (will mutate img object)
    skin.optimize(keep_ears=False)
    
    # Convert skin to old (before 1.8) format
    # This operation will create new Image object
    legacy_skin = skin.convert(MinecraftSkinFormat.LEGACY)

    # Save the result
    legacy_skin.image.save("path/to/result.png")
```

# Building from source

> [!WARNING]
> Make sure uv installed on your system

- Clone the repo:
  ```shell
  git clone https://github.com/Kiber2009/mineskin.git
  cd mineskin
  ```
- Build using uv
  ```shell
  uv build
  ```
- Distribution will be available in `dist` directory
