
#Minecraft skin maker program series#
This is the main advantage of treating everything as a series of transformations. Again, this is just created by building a reverse set of mappings (this time from the skin instead of the photo). This is not used directly, but can help check that the skin is correct before uploading it. Once we have built the entire set of mappings, the transformImage function builds a skin, using the mappings to cut out each body part.Īs an additional step, the program also generates a version of the skin in a more visual form (imagine unfolding a paper dice). If it should be copied from the photo, the corresponding photo co-ordinates are taken.

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 program 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). Working with a graphics editing program we can alter the files and create unique skins for our characters. Both of these files are included with this module. 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. The default Minecraft characters use two files called Steveskin.png and Alexskin.png to generate the textures for the player character, called a sprite. 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.
