0% found this document useful (0 votes)
467 views8 pages

How To Create Your Own Rubik's Cube Mosaic

This document provides instructions for creating a Rubik's cube mosaic using the free photo editing program GIMP. It outlines the necessary materials, introduces some challenges of the process like limited color palette and pixel count, and provides a multi-step guide including selecting an image, cropping, resizing to match the pixel count of available Rubik's cubes, and preparing the color palette from the cubes. The goal is to take a digital image and transform it into a pixelated form that can be recreated using Rubik's cubes arranged in a grid.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
467 views8 pages

How To Create Your Own Rubik's Cube Mosaic

This document provides instructions for creating a Rubik's cube mosaic using the free photo editing program GIMP. It outlines the necessary materials, introduces some challenges of the process like limited color palette and pixel count, and provides a multi-step guide including selecting an image, cropping, resizing to match the pixel count of available Rubik's cubes, and preparing the color palette from the cubes. The goal is to take a digital image and transform it into a pixelated form that can be recreated using Rubik's cubes arranged in a grid.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

How to Create Your Own Rubik’s Cube Mosaic

Using GIMP a Free Photo Editing Program


Written by Corey Milner
HighSchool Math
Colorado Springs, CO

Materials
 GIMP software – download for free at http://www.gimp.org/
 Rubik’s Cubes – borrow 100 or 225 Rubik’s Cubes at no charge for 8 weeks. For more details follow this link:
http://www.youcandothecube.com/cube-mosaics/

Introduction
As you can see in the picture above, a mosaic can be made by using an array of Rubik’s cubes. Each sticker on one face
of a cube acts as a “pixel” (9 pixels for each 3 x 3 Rubik’s Cube) and each cube gives you 6 colors in your palette to
choose from. There are many different ways a mosaic can be created, and there are many variations that can arise
when creating one. This guide was created by a teacher and students that were new to this process for others that are
new to the process, so this not intended to be comprehensive, but instead to give an introduction to mosaics and how to
do a very basic conversion. Good luck!

Challenges you may encounter:


 Your picture has too many pixels: A 15 Megapixel camera will give you a maximum picture resolution of 4752 x
3168 or over 15 million pixels! Chances are you aren’t going to have enough cubes to create your mosaic exactly
like your picture.
 Your picture has too many colors: The Rubik’s cube only has a 6 color palette so you will only have 6 colors to
work with.

However, even with these challenges, you can still have fun and create nice mosaics – it just might take a little time to
get used to. The You Can Do the Rubik’s Cube Program will lend you sets of 36, 100 or 225 cubes to create Mosaics for
an 8 week period for FREE. http://www.youcandothecube.com/cube-mosaics/
Step 1 – Let’s cube some 2d math!

You could take all your Rubik’s cubes and make a square and make your picture fit into that square, but that’s adding an
unnecessary limitation on top of those we just talked about. Doing a little bit of math we can come up with a list of
possible mosaic dimensions (the height and width). Once we have a picture, we can select the dimensions that most
closely match.

Analyzing the mosaic


How many cubes you will be working with will lead you to a number of choices for creating your mosaic. The first thing
we want to know is how many pixels we have to work with.

Example: You have 225 cubes => c = 225


c: cubes 9c = pt
pt: pixels (total) 9c = pt 9(225) = pt
so, you have 2025 pixels => 2025 = pt

You can now look at the range of lengths and widths you have to choose from, however, you can’t choose just any
height and width that give a product equal to your total pixels. Our example above had 2025 pixels (225 Rubik’s Cubes).
You cannot make a mosaic that is 81 pixels wide by 25 pixels tall. Remember that when actually building the mosaic you
are placing 1 cube at a time, which is 9 pixels at a time. This also means the height and width go up by 3 pixels at a time.
The height of 25 is not evenly divisible by 3, so we would not have enough cubes. For now, it will be simpler to keep our
units for area as cubes instead of pixels.

Generate a list of mosaic dimensions


A good starting point is to take the square root of the number of cubes available and then round down to get the largest
square that can be made. Our example of 200 cubes would give a result of √ (200) ≈ 14. This gives you a starting point
of a square made of 14 x 14 Rubik’s Cubes. You can decrease one dimension incrementally--just divide and round down.
Once you have this list you can then multiply to get the height and width in pixels:
√ (225) ≈ 15  15 cubes x 15 cubes x3 45 pixels x 45 pixels
(225/14) ≈ 16  14 cubes x 16 cubes x3 42 pixels x 48 pixels
(225/13) ≈ 17  13 cubes x 17 cubes x3 39 pixels x 51 pixels
(200/12) ≈ 18  12 cubes x 18 cubes x3 etc.

Another way to generate this list is using a spreadsheet. Rubik-Mosaic-Helper is an Excel spreadsheet that was created
to generate this list with the only input being the number of cubes. The spreadsheet is completely unlocked to
encourage users to look at the formulas used in the cells and look at the logic involved to see how these lists are
created.

Analyzing a picture
A picture’s resolution is usually given in pixels as height x width. We now want to see the resolution in total pixels to
compare to our mosaic constraints.
Example: Your picture is 1600x1200 => hp = 1600, wp = 1200
hp: height (in pixels) hp wp = pt
wp: width (in pixels) hp wp = pt (1600)(1200) = pt
so, the picture is 1,920,000 pixels => 1,920,000 = pt

This is why we came up with the total pixels number for the mosaic earlier. You can now compare the pixels we need to
what we actually have. The picture has almost 1000 times more pixels than our mosaic!
Step 2 – Smart image selection
This step becomes much more important if the number of cubes available to you is smaller. The general rule of thumb
here is to find a picture that coincides with the 2 main challenges of a Rubik’s Mosaic: 1) the fewer the number of colors,
the better, and 2) the fewer the number of total pixels the better. It was through trial and error that we found image
selection made the biggest difference in getting a good final result. Your results may differ, so play around! The
examples shown below will actually use a different image than that which we used to make our final mosaic to better
highlight some of the difficulties that arise from selecting a more difficult starting image.

Step 3 – Image manipulation


I will explain some tools that are available using an image manipulation program called GIMP (GNU image manipulation
program), which anyone can download for free. http://www.gimp.org/
I used version 2.6.11. If you use a different version you might need to search around for the same features. If you have
never done image manipulation you might need to refer to the GIMP user manual, since this document is focusing on
the lesser known features that are useful for Rubik’s mosaics.

Instructions on what to do within the GIMP program are indented from the rest of the text.
Open your target picture in GIMP:
Go to File → Open
Select your image

Cropping
First make sure the image you’ve selected is as small as possible. In our example we started with a 1600 wide x 1200 tall
picture, but decided to focus just on the horse’s head, and cropped to 320 wide x 830 tall. Your new pixel size can be
put into the mosaic helper spreadsheet.

In the Toolbox:
 Select the “Rectangle Select Tool”

In the Image window:


 Select the portion of the picture you would like to crop down to.
 Click to open the “Image” Menu
 Click “Crop to Selection”
Resolution
At this point you have a target image that is likely still much larger than the number of Rubik’s pixels available. This
means you have to decrease the number of pixels making up your picture. Note that image processing programs will
likely use the term “resolution” to mean pixels per inch, and “image size” to mean total pixels. The pixels per inch
setting only matters when printing your digital photo, which we won’t be doing. When using the term resolution we are
referring to the total number of pixels.

Scale
You now should have a list of possible height to width ratios and their pixels (either on your own or using the provided
spreadsheet). The Rubik’s height to width ratio that most closely matches the picture’s ratio is now chosen, and the
corresponding pixels are now used to set the pictures height and width. You are selecting only one number to use based
on this logic:
If ( Picture height:width ratio ) > ( Rubik’s Cube height:width ratio ), then ( use Height ), Else ( use Width ).

If you used the spreadsheet, column H will tell you which Rubik’s pixel number to use when setting this.

In GIMP, select “Image”, then “Scale Image” to get the scale image dialog window. Note the blue oval is highlighting a
chain icon. This icon represents whether or not the ratio of height to weight should be fixed. The default is fixed. If you
click this the icon changes to a broken chain, and this means that your final image will be more distorted. The trade off
here is distortion vs lost resolution, and we have usually chosen decreased resolution, but your results may vary. The
example will use a fixed ratio to minimize distortion.
Click the number in the “Image Size” field that corresponds with whichever dimension you have just determined to use
(our example is Width = 27). Press the tab key to select another field, and you should see the other dimension update to
keep height to width as close to the original ratio as possible (in this example our height is now 70 instead of 75 – this
shows how much resolution you have just lost). Click “Scale” and your image is now very small. In the bottom of the
image window you can make the percentage larger to zoom in. Your image is now the correct number of total pixels!
Color Palette
The Rubik’s Cube has 6 colors White, Yellow, Blue, Green, Red, and Orange. We are going to convert our picture to only
use these 6 colors.

Levels
Click “Colors”, then “Levels…” to open the Levels dialog window:
Input Levels in this window is actually one of the most valuable
tools to use for any image manipulation. In this window you can
fix a number of mistakes made when a picture was taken. In the
example to the right, you are looking at a graphical representation
of shadows, highlights, and midtones. The X axis is the scale from
black (0) to white (255), and the Y axis is the number of pixels at
each particular level. In the example, we can see that there are a lot of pixels in this picture that are white, or very
nearly white due to the larger Y values at the far right of the graph. There are 3 settings here that we are going to
adjust: Black level (also called black point or shadows), White level (also called white point or highlights), and Mid tone
(also called midpoint or gamma). Black level takes the value you have selected and makes all pixels equal or below that
value black. If you slide from 0 all the way up towards 255 you will see the picture fade to black. White level works the
same: all values above it become white. As you move black and white levels closer to each other, you are removing a
lot of colors (recall that our goal here is to eventually have only 6 colors). The gamma (or mid point) setting changes
from lighter/more color to darker/less color as you go left to right. Changing all of these values would also be equivalent
to changing contrast and brightness, but within the levels screen you have much more control over the settings. You
should now spend a fair amount of time playing with these values and watching how they change the image. The only
rule to follow here is you must bring black level and white level much closer together, but where they are on the chart
will vary for different pictures. For a lot of pictures this step will make the background simply disappear. If instead
your background is blending into the picture in a bad way, you might need to selectively delete it. Here is where we
ended up on our example, but there are many other choices for levels that also could have worked, but just looked
different:
Color Mode
While the number of colors has been drastically reduced already, we are now going to fix the number at 5 or 6. To do
this we are going to use a color mode called “indexed color”. This means we select the exact colors to use and GIMP will
change each pixel to its nearest color in the palette.

5 or 6 ???
It turns out that for a LOT of the pictures we have wanted to convert, the green color on the Rubik’s Cube doesn’t blend
as well: White through red blend very well and red to blue typically does
ok. However, blue to green often doesn’t look very good.
Once you try this a few times, it’s easy to switch colors around quickly.

Switch to Indexed
Click “Image”, then “Mode”, then “Indexed…” to open the “Indexed Color Conversion” dialog window.
Click “Generate optimum palette”, and enter “6” for maximum
number of colors.

Note the “Dithering” setting is “None”. Dithering is when 2 colors


are stitched together to give the illusion of another color or a
gradient between the two. Here’s an example of how red and blue
dithering can appear purple if the pixels are sufficiently small. You
can play around with different dithering settings to see if you like
them.
Convert Optimized Indexed to Rubik’s Palette
Click “Windows”, then “Dockable Dialogs”, then “Colormap”.

You can now see the 6 color palette that GIMP has selected based on the colors
that were left after setting levels. This is another method of interpolation;
however, GIMP doesn’t allow you to have any say in the implementation as
they do in other situations (like we saw in scaling).

Right click on any color, and select “Edit color…”. There are many different
methods available to select the Rubik’s Colors. Here are some example HTML
codes for them:

White Yellow Orange Red Blue Green


ffffff ffff00 ff9c00 f60000 3737b3 00d900

To Green or Not to Green


You can now play around with the colors and decide whether or not to use green. If you don’t want to, just repeat the
last step and choose only 5 colors. If you are more advanced with image manipulation, you might try leaving the green
and manually substituting dithering with other colors in the areas defined as green. Here are some examples we came
up with: (The left image is AFTER indexing to 6, but obviously before converting to Rubik’s Palette)

Which would you choose?

We decided none of these


were contenders to actually
become a mosaic, but
thought the 2nd image from
the left turned out OK.

Try Again?
As you do this more, you will start to get much faster at this, and you will start to know whether an image will come out
before you get there. One thing you must try with some image is to change up the order of manipulation. Since so
much of your final image comes from some mysterious math being done by the computer, changing the order can
dramatically alter the final product (for better or worse). If you decide to change up the order of manipulation crop
really should always be first, and if you do Indexed before levels, just don’t do levels at all… Here’s another example of
order:

Crop (this should always be first) >> Levels >> Indexed >> Scale >> Convert
Mosaic Time!
Building Instructions
Now you need to add some gridlines to your image, and decide on how many sections to break down into. Typically it
will make it easier for builders if the grid sizes are smaller. It makes it more manageable to get built without errors.
Then make digital copies that can be zoomed by the builders, or print out the grids. We opted to print a couple “big
picture” copies and then a zoom in of each grid:

Building Logistics –
You’ve gone to all this effort to make an image, then you’re going to put forth a bunch more to actually build it. Please
make sure you’ve thought about how people will see this before you get to that point! Here’s some thoughts/ideas:

1) Typically these will have more impact if people can view it from far away and up close.
2) Think about making a stand for your mosaic. In the example picture at the beginning of the document you
can see some wood framing. This was custom made for this project. The entire assembly could be tipped up
to about 10 degrees from vertical (totally vertical could make them fall!) to be seen from farther away.
3) Set up a camera on a tripod and take some video of the mosaic being made—then use some editing
software to speed up that video to make the building process time-lapse!
4) Make an event out of the building process
a. Find a sponsor—put some logo/ad behind where the cubes will go. The time-lapse will be extra fun
then! A sponsor might also help you finance getting more cubes!
b. Have lay people try to help solve cubes for the mosaic—it’s actually much easier than learning to solve a
cube, since it’s only solving one layer.

You might also like