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 64, 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.1.tar.gz (6.3 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.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pilskinmc-1.0.1.tar.gz
  • Upload date:
  • Size: 6.3 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.1.tar.gz
Algorithm Hash digest
SHA256 9940ca49b42ef26486d29bd6ce741fd758f2174c4f33f9677aeb3cb61bfdc428
MD5 4dfa691fd308e5b0ac15befe6d764855
BLAKE2b-256 56fe9e6113ada0e205047d58ac1c45435a9915804f0656078f25d4962e445d7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pilskinmc-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33d4efffdea2b0f3cee55d30275d09249a2bb8b8dd5d5114f93a74553c1de6df
MD5 12234bb8f2da3c74baca4d992698ad35
BLAKE2b-256 a9db51c2106a523b0bd824a48582d6e6a55622fb6f85b80250f8b2281d361925

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