LEGO Mosaics (BrickJournal)


A mosaic in the traditional sense is a picture or pattern created by arranging together small colored pieces of stone, glass, etc. As the name implies, a LEGO mosaic is a mosaic created using LEGO pieces. Unlike traditional mosaics where the pieces of stone or glass need to be cut to size and mounted on some kind of a substrate using glue, we can create a LEGO mosaic simply by attaching LEGO bricks, plates and other elements to one or more baseplates.

So, how exactly do you go about designing a LEGO mosaic ? Some LEGO artists have the amazing ability to use trial and error to create mosaics freehand, but the rest of us have to rely on some kind of software to aid us in this effort. We need this software to be able to take any image that we provide it and turn it into the best approximation that is possible of the image using the available LEGO pieces and colors.

To understand how LEGO mosaic software works, let us first take a closer look at the typical starting point for a LEGO mosaic – namely a digital image. Digital images may be ubiquitous on our smartphones and computers, but it is helpful to understand how the data in an image file is organized. An image is basically a 2-dimensional grid of square picture elements (or pixels) each of which has a particular color. All the pixels (especially when there are enough of them) blend together in our brains to create the illusion of a continuous image with light, shadows, shapes, colors and textures that resemble what we see in the real world.

The pixel grid in an image is analogous to the regular square grid of stud locations in the LEGO system. And so, if we can somehow map each pixel in the image to a LEGO 1×1 brick or plate, we can create a LEGO representation of the digital image, or in other words, a LEGO mosaic. However, it is not always as simple as that. In fact, a LEGO mosaic can at best only be a very crude approximation of the original image and there are two reasons for this – the resolution of the image and its color depth.


The resolution is the level of detail that is captured in the image and it is proportional to the number of pixels that it has (the more pixels that an image has, the more details it is able to capture). You normally cannot see the individual pixels that make up a digital image (unless you zoom into it all the way using a photo editor like Photoshop) and that is because of the sheer number of pixels that make up a typical image.

The earliest digital cameras from the late 1990s produced images with what would now be considered a very low resolution – typically something like 1024×768 pixels which is under 1 megapixel (a commonly used unit that is equivalent to 1 million pixels). But if we translate that to LEGO where the smallest element we can use to represent each pixel is a 1×1 brick or plate (with a footprint of 0.8×0.8 cm), we would end up with a LEGO mosaic that is 27×20 feet wide !

So clearly, we have to reduce the resolution (number of pixels) of the source image dramatically before we can represent it using LEGO. For instance, if we downsize the 1024×768 image by a factor of 8, we would end up with 128×96 pixels. This would work out to a large (but more manageable) mosaic that is 40×30 inches wide. This process comes with a significant loss of fine detail in the resulting LEGO mosaic. It is also more challenging to create the illusion of a continuous image because it is hard not to see the individual pixels that make up a LEGO mosaic. It’s no wonder that most LEGO mosaics don’t look like much when viewed up close. You always have to step back a few feet to get the intended effect of the mosaic.

Color Depth

Next, we look at color depth. In a typical color image, each pixel has 8 bits of data for each of the 3 primary colors – Red, Green and Blue. By combining these 3 primary colors in the correct proportion, we can represent more colors in the color spectrum than humans can actually perceive. Each bit can have two values (0 or 1) and so 8 bits allow us to represent a total of 2x2x2x2x2x2x2x2 = 256 total values (0 to 255) for the intensity of each primary color and together we have a total of 256x256x256 = 16.7 million possible combinations each of which is a distinct color in the color spectrum. When we create a LEGO mosaic we have to map those 16.7 million colors to the 40 or so commonly available colors in the LEGO color palette.

As you can imagine, this also results in a significant loss of the detail in the image that comes from the gradations of light, shade and color. It also creates limitations on the kinds of images that can be represented well using LEGO mosaics (for instance, images that have subtle gradations of a small number of colors do not always translate to LEGO very well).

Motivation for Creating a New Program

While there is no dearth of software options available (some free, others not) for converting digital images into LEGO mosaics including the mosaic maker that is part of LEGO’s own Bricklink Studio software, I didn’t find any of them to be up to the task of converting cross stitch patterns into LEGO mosaics.

LEGO as you may recall, is based on a regular square grid of stud locations. But it is not the only art/craft form that relies on a regular square grid. In fact, there are other crafts like cross stitch and diamond painting that also use a regular square grid. The designs for these crafts are depicted as patterns made up of colored squares that are laid out in a grid (these squares would be occupied by stitches in a completed cross stitch or flat beads known as “diamonds” in a diamond painting).

There are a wealth of cross stitch and diamond painting patterns available online (many of them for free) that could be adapted into LEGO mosaics but the process of doing this manually (one pixel at a time) can be tedious and time consuming. This prompted me to brush off my coding skills to create my own program that could automate the conversion of cross stitch patterns into LEGO mosaics.

But once I accomplished that original goal, I decided to extend my program to be able to create various kinds of LEGO mosaics not just from cross stitch patterns but regular images as well. In this article I will be covering the different types of LEGO mosaics and also providing some insights into the inner workings of my program.

Types of LEGO Mosaics

i) Studs-out Mosaics

Studs-out mosaics are the most common type of LEGO mosaics. They are created by attaching LEGO bricks or plates to a LEGO baseplate with their studs facing out. Each pixel is represented by a 1×1 brick or plate which happens to have a square footprint. One advantage of using regular bricks or plates is that they can be combined into longer pieces when the mosaic pattern allows it (when two or more neighboring pixels have the same color) for a reduced overall piece count. However, some prefer to avoid having blocky pixels in their studs-out mosaics by using 1×1 round plates instead or even 1×1 round tiles that have no studs showing (as in the LEGO Art sets).

ii) Studs-up Mosaics

One way to increase the resolution of LEGO mosaics (albeit in just one dimension) is by building them with their studs up. LEGO plates are thinner counterparts of bricks and they are thinner by a factor of 2.5 compared to the regular stud dimension.

And so if we stack LEGO plates such that the design of the mosaic is created by plates as seen from their side, we can pack more detail into the same overall size. One obvious downside is that we now have to deal with rectangular pixels. Studs-up mosaics are also more challenging to build practically speaking because we are creating the mosaics by stacking plates rather than attaching them to a baseplate. This can lead to stability issues especially if the design of the mosaic does not allow for the plates to be overlapped correctly for a stable structure (in most cases we may have to make the mosaic 2 studs deep allowing longer plates to be attached horizontally behind the mosaic for improved stability).

While studs-up mosaics are usually built using LEGO plates, some may prefer to use bricks instead which results in a larger pixel that is still not square in size (given that a 1×1 LEGO brick is slightly taller than it is wide).

iii) Lenticular mosaics

A lenticular mosaic creates the illusion of an image that changes with the viewing angle. Lenticular mosaics (along with lenticular wall displays) take their inspiration from a 16th century invention called tabula scalata (or “turning images”). A tabula scalata has two images divided into vertical strips and printed on different sides of a corrugated surface allowing the two entirely different images to be seen depending on the viewing angle.

Back in 2010, AFOL Chris Doyle stumbled upon the idea of creating lenticular LEGO mosaics using cheese slope pieces. He placed the cheese slope pieces such that they faced opposite directions (left vs. right) in alternate columns. This created a corrugated surface similar to what is used in a traditional lenticular mosaic and allowed two distinct images to be combined into a single LEGO mosaic (with only one image visible when the mosaic is viewed from either the left or the right side).

iv) Isometric pattern mosaics

The 2×2 triangular tile is a relatively new addition to the LEGO catalog (it was introduced in 2018). However, it opens up a lot of new possibilities for mosaics when it is combined with regular 2×2 square tiles. These 2×2 tiles can be used to create a wide range of interesting mosaics that represent isometric geometric patterns (patterns that do not have the perspective distortion that you would normally see in a 3D representation).

There is no good way to create these mosaics using software but I decided to include them here anyway (I have explored isometric pattern mosaics extensively but they are typically built digitally one piece at a time).

Steps Involved in Creating a LEGO Mosaic from a Digital Image

i) Image Resizing

We have seen how a typical digital image has too many pixels for it to be represented as is, in LEGO mosaic form. The first step to creating a LEGO mosaic is resizing the image to match the size (in pixels) of the LEGO mosaic that we are planning to build. We have to take care to ensure that our original image has the same aspect ratio (proportions) as our mosaic (this can be achieved by selectively cropping the image) to ensure that we don’t distort our image when we resize it.

If we want our LEGO mosaic to be say 128×96 studs wide, the image will first have to be resized to have 128×96 pixels at least in the case of a studs-out mosaic. Things get a little more tricky for studs-up and lenticular mosaics. The pixels in studs-up mosaics are rectangular and so we can fit more of them (2.5 to be exact) in 1 stud dimension vertically. And so, the image will have to be resized to 128×240 pixels (240 is 96 times 2.5) and this way when we build the mosaic using the sides of 1×1 plates (which are much wider than they are tall), the completed mosaic has the correct proportions. In the case of lenticular mosaics, we are dealing with two different images that need to be combined. We will need to resize each image to have half the width (in terms of pixels) of the finished mosaic (which works out to 128×48 in our example) and interleave the columns of pixels in the two images for a total size of 128×96 pixels.

There are several different algorithms that can be used to resize images. A common one that works well enough in most cases is Lanczos Resampling (something you may have come across in Photoshop and other image editing software). However, when we are starting with an image (such as a cross stitch pattern) that already has a pixelated appearance, a different method like Box Resampling can prove to be useful. This method works by breaking the original image into boxes (which can correspond to the “pixels”) and averages the colors inside each box.

ii) Color Quantization

Color quantization is the process of decreasing the color depth of an image (or reducing the number of distinct colors that it uses). This is an important step for the creation of the LEGO mosaic because it involves going from an image that has millions of distinct colors to one with the 40 or so colors in the LEGO color palette. The method used for this step has a great bearing on how well the LEGO mosaic resembles the original image.

The simplest method (and least intensive computationally) is to remain in the RGB color space (which is essentially a 3-dimensional space with the three primary colors Red, Green and Blue making up the 3 dimensions) and for each color in the original image, find the nearest neighbor in the more limited color palette (the LEGO palette this case). But this method doesn’t always align with the way humans perceive similarity between colors.

An alternative is to use the L*a*b* color space which was designed to better represent the way humans perceive color. It is also a 3-dimensional space where L* or lightness is an achromatic component that represents shades of grey and the a* and b* components represent the proportions of the primary colors (red, green, blue and yellow). By converting all our colors from RGB to the L*a*b* and using the Delta-E algorithm to compute the difference between colors in the L*a*b* color space, we can create LEGO mosaics that more closely resemble the original images that we started with.

iii) Dithering

While there is no good way to counter the loss of resolution that the creation of a LEGO mosaic entails, we can use dithering to somewhat alleviate the loss of color depth. Dithering is a technique that allows an image with a wide gamut of colors to be represented using a much more limited color palette. It involves arranging pixels in the available colors in such a way that they collectively emulate the colors that are missing. This technique was used historically in early computer displays that had very limited color palettes. Inkjet printers to this day use halftoning which is a form of dithering (in this case the individual dots or pixels can vary in size).

Here is a simple example that may help illustrate the concept of dithering – suppose we want to display shades of gray and only have the option of using either black or white. Neither black nor white can really pass for gray and yet if we have enough pixels to work with, we can create checkerboard patterns with the right proportion of black and white pixels that combine to create the illusion of various shades of gray. In the same way, if our original image includes colors that do not exist in the LEGO palette, we can arrange LEGO pieces in the available colors in such a way that they combine in our brains to create the illusion of seeing the colors that are missing.

More on the New Mosaic Program

While it is beyond the scope of this article to provide a step-by-step breakdown of how the mosaic program works, it more or less carries out the basic steps I have listed above. The inputs to the program are a digital image (or two if a lenticular mosaic is desired) along with the type of mosaic (studs-out, studs-up or lenticular) as well as the dimensions of the final mosaic in terms of LEGO studs. In the case of studs-out mosaics, there is an option to use regular plates (which are automatically combined into longer ones wherever possible), round plates or round tiles. Similarly, studs-up mosaics can be built using either plates or bricks.

Dithering can be enabled if needed along with box resampling (if the starting image is a cross stitch or diamond painting pattern). The program uses the L*a*b* color space and the Delta-E algorithm to ensure that the mapping of colors to the LEGO color palette is done as accurately as possible. The output is a Ldraw file which is a common format used to specify LEGO models. This file can be imported into Bricklink Studio as well as LDD. I am still working on developing a graphical user interface for the program as well as the ability to output a parts list that can be exported to Bricklink (without the need to use Studio) and possibly building instructions for the mosaics.