iyashk / Image2MCBlock

Convert images and videos into Minecraft blockerized files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image2MCBlock
Convert images or videos to minecraft blockerized file

Installation

To install Image2MCBlock, download repo, and simply use pip:

pip install -r requirements.txt

How to run:

usage: main.py [-h] [--filter FILTER [FILTER ...]] [--scale_factor SCALE_FACTOR]
               [--method {abs_diff,euclidean}]
               [--png_atlas_filename PNG_ATLAS_FILENAME]
               [--txt_atlas_filename TXT_ATLAS_FILENAME]
               path_to_file output_file

Launch class arguments

positional arguments:
  path_to_file          Path to the input file
  output_file           Path to the output file

options:
  -h, --help            show this help message and exit
  --filter FILTER [FILTER ...]
                        Filter options
  --scale_factor SCALE_FACTOR
                        Scale factor
  --method {abs_diff,euclidean}
                        Method of finding the closest color to block
  --png_atlas_filename PNG_ATLAS_FILENAME
                        PNG atlas filename
  --txt_atlas_filename TXT_ATLAS_FILENAME
                        TXT atlas filename

Example:

python main.py old_image.png blockerized_image.png

Filter example:

python .\main.py old_image.png blockerized_image.png --filter gray_wool black_wool light_gray_wool Image2MCBlock

How to use textures from newer versions?

Code uses Texture atlas from minecraft. (1.19.4)

To get the new textures of current latest update, you need to go in the last version of the game and press F3+S, that will generate output in chat, press it, and then copy&paste minecraft_textures_atlas_blocks.png_0.png, minecraft_textures_atlas_blocks.png.txt to the root folder.

About

Convert images and videos into Minecraft blockerized files


Languages

Language:Python 100.0%