Convert any picture into a Rubik's Cube-style mosaic, using only official Rubik cube colors (red, green, blue, white, yellow, orange). The script calculates how many cube pieces you need and the size of the frame.
rubic/
βββ image_to_rubic.py
βββ your_image.png
βββ rubik_output.png # Output image (autogenerated)- Put your image in the same folder as the script.
- Open your terminal in that folder.
- Run the script with:
python image_to_rubic.py your_image.png 12000Where:
your_image.pngis your input image.12000is the number of Rubik cubes you want to use.
[β
] Rubik-style image saved as 'rubik_output.png'.
[π] Required Rubik frame: 109x109 cubes
[π] Total frame size: 218 cm x 218 cm- π΄ Red
- π Orange
- π‘ Yellow
- π’ Green
- π΅ Blue
- βͺ White
Make sure to install dependencies:
pip install pillow numpy- Each Rubik tile is 2 cm x 2 cm.
- Final frame size is calculated based on number of cubes per side.

