Minecraftize is a Python project that converts regular images into Minecraft-style images using block textures. It analyzes each pixel of the input image and replaces it with the most similar Minecraft block texture.
- Convert any image into a Minecraft-style image
- Multithreaded processing for faster conversion
- Command-line interface for easy usage
You can go to examples directory to see before and after images of some of Hack Club's stickers. You will need to zoom in a lot to see the actual blocks!
- Python 3.6+
- Pillow (PIL Fork)
-
Clone this repository:
git clone https://github.com/artem4852/minecraftize.git cd minecraftize
-
Install the required packages:
pip install pillow
-
Set up the Minecraft textures (see "Texture Setup" section below)
-
Run the script with the following command:
python main_v2.py
-
When prompted, enter the path to the image you want to convert.
-
Optionally, specify the number of threads to use for processing (default is 10).
-
The converted image will be saved in the same directory as the original image with "_converted" appended to the filename.
-
Run the script with the following command
python main_v1.py -p <path_to_image> -t <number_of_threads (optional)>
-
The converted image will be saved in the same directory as the original image with "_converted" appended to the filename.
Due to copyright restrictions, we cannot distribute Minecraft textures. To use this project, you'll need to extract the textures from your own copy of Minecraft. Here's how:
-
Locate your Minecraft installation folder:
- Windows:
%APPDATA%\.minecraft
- macOS:
~/Library/Application Support/minecraft
- Linux:
~/.minecraft
- Windows:
-
Find the version folder you want to use (e.g.,
versions/1.16.5
) -
Open the
.jar
file for that version (you may need to rename it to.zip
and then extract it) -
Navigate to
assets/minecraft/textures/block
in the extracted files -
Copy all the
.png
files from this folder into atextures
folder in your project directory -
Run
load_avg_values.py
to generate theavg_values.json
file:python load_avg_values.py
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
This project is not affiliated with Mojang or Microsoft.