Skip to main content

Minecraft Skin Preprocessing Tools

Project description

minecraft-skin-preprocessing

A Minecraft skin preprocessing Python script.

Features

  • Convert legacy 64x32 skins to modern 64x64 format.
  • Swap layer2 and layer1 for skins.
  • Swap layer2 and layer1 twice to remove invalid areas.
  • Remove specified layer (1 or 2) for skins.
  • Process skins from Base64-encoded strings.
  • Batch processing of skins in folders.
  • Customizable output folder for converted skins.
  • Option to overwrite existing files.

Update

  • 2025-10-28: able to build wheel via source code.

Installation

Install the package using pip:

pip install mcskinprep

Usage

Command Line Interface

The package provides a command line interface for easy skin preprocessing.

Arguments

  • input: Input file or folder path (optional).
  • -c, --convert: Convert 64x32 skins to 64x64 format.
  • -i, --input-folder: Specify the input folder containing skins.
  • -o, --output-folder: Specify the output folder for converted skins.
  • -s, --swap-layer2-to-layer1: Swap layer2 to layer1 for skins.
  • -ss: Swap layer2 and layer1 twice to remove invalid areas.
  • -rm, --remove-layer: Remove specified layer (1 or 2) for skins.
  • -b, --base64: Process Base64-encoded skin images.
  • --overwrite: Overwrite existing files.
  • -h, --help: Show help message.
  • -v, --version: Show version information.

Examples

Convert format of a single skin (64x32 to 64x64)

mcskinprep -c old_skin.png

Convert all skins in a folder

mcskinprep -c -i skins_folder

Convert with a custom output folder

mcskinprep -c -i old_skins -o new_skins

Convert and overwrite existing files

mcskinprep -c -i skins_folder --overwrite

Swap layer2 and layer1 for a single skin

mcskinprep -s old_skin.png

Swap layer2 and layer1 twice (to remove invalid areas)

mcskinprep -ss old_skin.png

Remove layer2 from a skin

mcskinprep -rm 2 old_skin.png

Convert skin from a Base64 string

mcskinprep -c -b base64_skin_string

Python API

The package also provides a Python API for programmatic skin preprocessing.

Examples

usage of core tools

from mcskinprep import MCSkinTools
from PIL import Image

# Create tools instance
tools = MCSkinTools()

# Load an image
img = Image.open("skin.png")

# Convert 64x32 to 64x64
converted_img = tools.convert_skin_64x32_to_64x64(img)

# Swap layers
swapped_img = tools.swap_skin_layer2_to_layer1(img)

# Remove layer
layer_removed_img = tools.remove_layer(img, layer_index=1)

# Save results
converted_img.save("converted_skin.png")

usage of file processor

from mcskinprep import MCSkinFileProcessor

# Create processor instance
processor = MCSkinFileProcessor()

# Convert a single 64x32 skin to 64x64
processor.convert_skin_64x32_to_64x64("old_skin.png", "new_skin.png")

# Swap layers in a skin
processor.swap_skin_layer2_to_layer1("skin.png", "swapped_skin.png")

# Swap layers twice to remove invalid areas
processor.twice_swap_skin_layers("skin.png", "clean_skin.png")

# Remove a specific layer
processor.remove_layer("skin.png", "no_layer1_skin.png", layer_index=1)

# Batch process skins in a folder
processor.batch_convert_folder(
    convert_func=processor.convert_skin_64x32_to_64x64,
    input_folder="input_skins/",
    output_folder="output_skins/",
    overwrite=False
)

License

This project is licensed under the MIT License.

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

mcskinprep-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

mcskinprep-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file mcskinprep-0.1.0.tar.gz.

File metadata

  • Download URL: mcskinprep-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.5

File hashes

Hashes for mcskinprep-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d9c757f6804448fa3114248eec04548888c785d2d345220590963fa4529fdcba
MD5 4498f590c1afa4364df188f53fdf3d64
BLAKE2b-256 8c4f5bb1ab5fc56f303a70acbf69fb243ae124c566c59230b7430f0cc5957763

See more details on using hashes here.

File details

Details for the file mcskinprep-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcskinprep-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.5

File hashes

Hashes for mcskinprep-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1b0de4f048edef02bdc20b8c7622d0d010181ec03a3f4e77d3984f0fcc239a4
MD5 efc916c044f519175619f0f0e1be8d4a
BLAKE2b-256 15cd8f3989f1faa6eb6df547b507a2a429355a28e6e0d49ea489153178af1829

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