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.2.tar.gz (6.8 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.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pilskinmc-1.0.2.tar.gz
  • Upload date:
  • Size: 6.8 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.2.tar.gz
Algorithm Hash digest
SHA256 b4611437c1c3081b5d411ad60a1fbaf4d618956f6ecd8f06cf8bf9e79ac99860
MD5 25e3f1e3b42f7121ff69fe12062e500a
BLAKE2b-256 fc3bf0216098ae0edea397c23692fa1db0a92f72a9d3d82639d3eec2a3e75ed8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pilskinmc-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e48e50da7d30d9b36e839760f3f0981e7374cbf1cbe758dd8639c04cdb4ea3ac
MD5 c8839aaa0f849f8fb338e9c6d49b6e24
BLAKE2b-256 43311f160481a8dc6447cb7944a6adfc7451efae436232cb0ed4b9bb4f63e314

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