

This is constructed by iterating over each body part in our dictionary and deciding if it can be taken from the photo (some body parts don't look good when taken from the photo, and are instead painted with a colour). These tell the program where to find pieces of the skin in the source photo. The main heavy lifting is done by the set of mappings. Before starting, it resizes the photo to match the resolution of the Minecraft skin.

MINECRAFT SKIN MAKER CODE
A set of co-ordinates are provided to tell the code where to start extracting the skin (allows you to choose the best part of the photo). The main program loads the provided photo. These values are used to move to/from the different co-ordinate spaces in the skin/photo. The format is taken directly from the wiki page and consists of the co-ordinates of the part in the skin, and the corresponding co-ordinates in the photo. This simplifies the building of the skin later on, and allows body parts to be accessed more easily ('headTop', 'rightArmTop' etc). The script uses the PIL (Python Imaging Library) to load the photo and manipulate it.Ī dictionary is created to define the format of a Minecraft skin. If you load this into Minecraft, you will be able to run around looking like a pumpkin.

The script will generate a Minecraft skin file like this: This is the program I came up with - a python script which processes a photo and outputs a Minecraft skin.įor example, if you give it a photo like this: What I wanted was a way to choose a photo and have this 'wrapped' around my Minecraft character. There are many online skin editors on the internet, but these all require you to painstakingly edit the skins - clicking each pixel, choosing a colour etc. Minecraft allows users to create and customise their skins and use these in the Minecraft game.Įach skin is defined as a bitmap with a specific format which is uploaded to the Minecraft server. Python tool to convert a photo to a Minecraft skin.
