Skip to content

BDR-Pro/RubicCube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧊 Rubik Image Converter

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.


πŸ“ Folder Structure

rubic/
β”œβ”€β”€ image_to_rubic.py
β”œβ”€β”€ your_image.png
β”œβ”€β”€ rubik_output.png       # Output image (autogenerated)

πŸ–₯️ How to Use

  1. Put your image in the same folder as the script.
  2. Open your terminal in that folder.
  3. Run the script with:
python image_to_rubic.py your_image.png 12000

Where:

  • your_image.png is your input image.
  • 12000 is the number of Rubik cubes you want to use.

πŸ–ΌοΈ Example Output

[βœ…] Rubik-style image saved as 'rubik_output.png'.
[πŸ“] Required Rubik frame: 109x109 cubes
[πŸ“] Total frame size: 218 cm x 218 cm

🎨 Rubik Colors Used

  • πŸ”΄ Red
  • 🟠 Orange
  • 🟑 Yellow
  • 🟒 Green
  • πŸ”΅ Blue
  • βšͺ White

πŸ”§ Requirements

Make sure to install dependencies:

pip install pillow numpy

πŸ“ Assumptions

  • Each Rubik tile is 2 cm x 2 cm.
  • Final frame size is calculated based on number of cubes per side.

Example results

Original Rubik Output

About

Turn any image to rubic ready image

Topics

Resources

Stars

Watchers

Forks

Languages