pillow-minecraft-map
A plugin for the Python Imaging Library Pillow (PIL) that enables loading, viewing, saving, and manipulation of Minecraft .dat map item files.
Features
- Open Minecraft maps using standard Pillow syntax (
Image.open("map_0.dat")). - Exposes location details (
xCenter,zCenter,scale) to Pillow's.infoattribute.
Important Note on Compatibility
Only Minecraft Java Edition map files are supported at this time. Minecraft Bedrock Edition utilizes a different map info format.
Installation
Install the package via pip:
pip install pillow-minecraft-map
Usage
Import the module to register the .dat plugin handlers into Pillow's image loader database.
Reading Map Images
from PIL import Image
import pillow_minecraft_map # Activates the extension
# Open the map file
with Image.open("tests/data/map_130.dat") as img:
# Convert from 8-bit color-indexed format ("P") to True Color ("RGB")
rgb_img = img.convert("RGB")
# Open inside your system's default image viewer
rgb_img.show()
# Export it to a standard format
rgb_img.save("minecraft_map_render.png")
Accessing Map Metadata (info)
The plugin maps in-game positioning values into the image's .info dictionary:
from PIL import Image
import pillow_minecraft_map
with Image.open("tests/data/map_130.dat") as img:
x = img.info.get("x_center")
z = img.info.get("z_center")
scale_factor = img.info.get("scale")
version = img.info.get("data_version")
# Calculate real-world block coverage
block_width = 128 * (2 ** scale_factor)
print(f"Minecraft DataVersion: {version}")
print(f"Center Coordinates: X={x}, Z={z}")
print(f"Scale: 1:{2**scale_factor} ({block_width}x{block_width} blocks total)")
Saving map files
To see your image in-game, you must overwrite a map file previously created in-game. If you are targetting versions of Minecraft older than version 1.17, it's very important that you specify the target minecraft version in your save() command.
from PIL import Image
import pillow_minecraft_map
with Image.open("hopper.jpg") as img:
img.save("map_0.dat", format="MINECRAFT_MAP", version="26.2")
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for pillow-minecraft-map 1.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pillow_minecraft_map-1.1.6.tar.gz | 10.6 MB | Without provenance | Details for pillow_minecraft_map-1.1.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pillow_minecraft_map-1.1.6-py3-none-any.whl | Python 3 | none | any | Details for pillow_minecraft_map-1.1.6-py3-none-any.whl |
Total release size: 10.7 MB
Release files / pillow_minecraft_map-1.1.6.tar.gz
| Download URL | pillow_minecraft_map-1.1.6.tar.gz |
|---|---|
| Size | 10.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34b5bfde2607d91d504f564a2c98f8645652497f24f7f60cd717e69d158cbe62
|
|
BLAKE2b-256 checksum How to use checksums |
dafb8a3bcdfb0e08cfc958f3cf9daecb056b60638193edbd7ca8542131c8b83a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.13
|
Release files / pillow_minecraft_map-1.1.6-py3-none-any.whl
| Download URL | pillow_minecraft_map-1.1.6-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9bb4561e437eb113ba7245b0e2551a8ad31e5daa4fc62bfddf2a1214bce4789d
|
|
BLAKE2b-256 checksum How to use checksums |
265b26e3710ad9a07840479400c792d13d90524fbc439d948342392a6f661c67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.13
|
Security for pillow-minecraft-map 1.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.