Skip to main content

PILSkinMC is a basic Minecraft player skin renderer for Python's PIL (Pillow) library.

Project description

PILSkinMC

PILSkinMC is a basic Minecraft player skin renderer for Python's PIL (Pillow) library.

Table of Contents

Install

To install from PyPi

# Linux/mac
python3 -m pip install PILSkinMC

# Windows
py -3 -m pip install PILSkinMC

How it works?

The library uses an isometric grid view to render skins with added shading to give a simple yet effective 3D look. Once imported you can simply paste in a pre-loaded skin file as such.

image = Image.new('RGBA', (400, 400))
skin = Image.open('skin.png').convert('RGBA')

paste_skin(image, skin, xy=(20, 20))

Positioning

The xy coordinates will be at the top left of the rendered model, if you require help with more complicated positioning you can use the skin_get_bbox() function to get the bounding box of the full model.

Skin type (poses)

By default the paste_skin() function will presume skins are of the wide 4px arm variant, this can be changed by parsing in a pose which can be one of 4:

  • PILSkinMC.poses.SLIM
  • PILSkinMC.poses.WIDE
  • PILSkinMC.poses.SLIM_GRUM
  • PILSkinMC.poses.SLIM_GRUM

(yes I added custom poses for Grum/Dinnerbone variants)

Scaling

By default the paste_skin() function will render skins at a scale of 32, this is the size of the theoretical isometric grid that the skin is being rendered off of. To change it simply parse a scale with any integer value.

Note: It is recommended to only use scales that are powers of 2 (4, 8, 16, 32, 64, 128, etc) as irregular values can sometimes cause gaps in the resulting image.

The scale option can also be used in the skin_get_bbox() function to get the bbox with the desired scaling.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pilskinmc-1.0.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pilskinmc-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file pilskinmc-1.0.0.tar.gz.

File metadata

  • Download URL: pilskinmc-1.0.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pilskinmc-1.0.0.tar.gz
Algorithm Hash digest
SHA256 048a3a6f2650a1e06cc75e2c1c4a8f7689e5e2a6b77e8d6eca02d11dda382cb7
MD5 f8ce3fc168e79071633f7d1171bdaa55
BLAKE2b-256 cee397c53d9b4ea8885042b73e6b0d6ee846a4e7719832cc2fd8fb55152f72e3

See more details on using hashes here.

File details

Details for the file pilskinmc-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pilskinmc-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for pilskinmc-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2a24abbad8aa5e01b16ebe351ea203141370a2c8b746a7afeb0715e6ef4cc2ef
MD5 0e5aa8c783a67e01c9c9855a80f35e95
BLAKE2b-256 d5ebd8fabaaaa6ccff4fd2b3fdd74416254c90dce4dc02ee5ee8e4d51481f0f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page