Turn any image into a Minecraft pixel art wall in seconds!
Just upload an image, click a button, and watch it build instantly.
- Quick Start
- How It Works
- Installation
- Step-by-Step Guide
- In-Game Instructions
- Tips & Tricks
- Troubleshooting
- Reference
# 1. Install dependencies
pip install pillow pyautogui pyperclip
# 2. Run the tool
python image.py
# 3. In Minecraft
/reload
/function your_art:buildThat's it! Your pixel art appears instantly โจ
๐ท Image โ ๐จ Color Matching โ ๐ Command Generation โ ๐ฆ Datapack โ โ๏ธ Minecraft
1. ๐ผ๏ธ Image Processor
- Resizes using
NEARESTinterpolation (preserves pixel edges) - Extracts RGB values from each pixel
- Stores grid in memory:
block_grid[y][x] = block_name
2. ๐ฏ Color Matcher
- Loads CSV with min/max hex ranges
- Calculates block color as average of range
- Uses Euclidean distance:
dยฒ = (r1-r2)ยฒ + (g1-g2)ยฒ + (b1-b2)ยฒ - Caches results for blazing-fast O(1) lookup
3. โก Command Generator
- Scans rows bottomโtop (Y-axis flip)
- Detects consecutive same-color pixels โ creates horizontal runs
- Outputs
/fillfor runs (โฅ2 blocks) or/setblockfor singles - Reduces 50,000 block commands to ~5,000!
4. ๐ฆ Datapack Builder
- Splits commands into 500 per file
- Creates batch chain:
build โ batch_0 โ batch_1 โ ... - Generates
pack.mcmetawithpack_format: 105 - Each file calls next in sequence to prevent stack overflow
| Metric | Value |
|---|---|
| โก Blocks/second | 50,000+ |
| ๐ Command reduction | 10ร |
| ๐ Max resolution | 2048ร2048 |
| ๐ File limit | 500 commands/file |
| โฑ๏ธ Build time | <1 second |
###I have put a also a exe of tool, You can get it in release.
Download from python.org (version 3.10 or newer)
Open Command Prompt (CMD) and run:
pip install pillow pyautogui pyperclipPlace these two files in the same folder:
image.py- The main programblocks.csv- Block color data
๐ก Pro Tip: Create a shortcut to run from anywhere:
doskey mcimage=python "D:\YourFolder\image.py"
Double-click image.py or run:
python image.pyClick "Upload Image" and select your picture (PNG, JPG, BMP, or GIF).
- Width: How wide you want the wall (recommended: 64-200)
- Height: Auto-calculates to keep proportions
- Start X / Start Z: Where the wall begins
- Bottom Y: Height level (recommended: 100 for easy viewing)
- Facing: Choose South, North, East, or West
๐ก Tip: Use
Y=100andFacing=Southfor the easiest viewing.
Pick a color for empty areas (black concrete works great).
Click "Start Building" โ Select "Generate Datapack"
- Enter a name (lowercase, no spaces)
- Example:
cat_artormural - Select your world's
datapacksfolder
๐ Path:
.minecraft/saves/YourWorld/datapacks/
Open your world and run:
/reload
Run this command (replace cat_art with your datapack name):
/function cat_art:build
Done! Your pixel art appears instantly โจ
Sometimes Minecraft pauses large builds. Just run:
/function cat_art:build
Again and it continues right where it left off.
- Use high-contrast images (simple designs work better)
- 64ร64 is a good starting size
- Y=100 keeps it above ground
- Facing=South gives the best view
- Save your setup as a JSON file for quick reuse
- Click "Save JSON" after processing an image
- Click "Load JSON" to restore it later
| Facing | X | Y | Z |
|---|---|---|---|
| South | x0 + col | y0 + (h - 1 - row) | z0 |
| North | x0 + col | y0 + (h - 1 - row) | z0 - 1 |
| East | x0 + 1 | y0 + col | z0 + row |
| West | x0 - 1 | y0 + col | z0 + row |
| Issue | Solution |
|---|---|
| "CSV file not found" | Make sure blocks.csv is in the same folder as image.py |
| Datapack doesn't load | Run /reload โข Check folder name (must be lowercase) โข Verify correct datapacks folder |
| Colors look wrong | Tool matches closest available block. Some colors aren't perfect but very accurate! |
| Image is upside down | Check your Facing setting. South usually works best. |
| Missing blocks/holes | Disable "Use /fill for horizontal runs" in settings |
| Library | Purpose |
|---|---|
Pillow |
Image processing |
PyAutoGUI |
Keyboard automation |
Pyperclip |
Clipboard access |
block_name,min_hex,max_hex
minecraft:stone,7a7a7a,8e8e8e
minecraft:grass_block,5a8a2a,6e9e3e
minecraft:black_concrete,121212,242424Your datapack will look like this:
cat_art/
โโโ pack.mcmeta
โโโ data/
โโโ cat_art/
โโโ functions/
โโโ build.mcfunction โ Entry point
โโโ batch_0.mcfunction โ Calls build_0 โ build_4
โโโ batch_1.mcfunction โ Calls build_5 โ build_9
โโโ build_0.mcfunction โ 500 commands
โโโ build_1.mcfunction โ 500 commands
โโโ ...
Builds a 100ร100 wall at X=0, Y=100, Z=0, facing South:
/function cat_art:build
๐ค Upload โ โ๏ธ Generate โ ๐ /reload โ โก /function yourname:build
Your pixel art is ready! ๐จ
Made for Minecraft Java Edition 1.20+