Thursday, April 14th, 2011...3:32 pm
Sugar-coated CoM&Mander-in-Chief
Let’s play with some food and create mosaics with pieces of candy. We need to place the treats so the resulting image will visually approximate an underlying picture. In this post, you’ll have the opportunity to create mosaics with a variety of candies. For now, we’ll use M&Ms. Fortunately, they melt in your mouth and not in your hand, giving us ample time to create our tiling. Our palette will be the colors from a standard bag of the M&Ms as seen below.
The image we want to approximate with a tiling will be called our target image. Let’s use the poster from the 2008 presidential election that depicted a stylized image of Barack Obama and became synonymous with the campaign.
Our tiles will replace square regions of our target image. For example, the image to the right is such a square region from the image above.
This region is a collection of color pixels. Each pixel is represented as a coordinate triplet (r, g, b), where r is the amount of red, g is the amount of green and b is the amount of blue. For each square region, the average “color” is computed by averaging the red, blue and green intensities of each pixel in the region.
The color of M&Ms could be found in a similar way. Instead, we’ll take the color of an M&M to equal the color of a pixel within an image of an M&M with the same color.
Which M&M replaces a given square? The M&M with the “closest” color to the square of interest. For example, suppose the average color of a square region is (120.75, 40.25, 103.25). Let’s take the color of a blue and red M&M to be (0, 48, 106) and (202, 18, 44), respectively.
The distance between the average color and the blue M&M would be
The distance between the average color and a red M&M would be
So, between a blue and red M&M, we choose the red M&M.
How does such a method do in constructing a mosaic? Recognize the mosaic below?
What if we use more or less M&Ms? What if we try a different target image? What happens with other types of candy?
What if we use more or less M&Ms? What if we try a different target image? What happens with other types of candy? Click the image below to visit a webpage that contains an applet to let you explore such questions!
Once you’ve created an image you like, go and buy a bag (maybe several) of M&Ms, Jelly Bellies, Kisses, Peeps or Gummy Bears and make your mosaic by hand!
The best part is taking it apart!



33 Comments
April 18th, 2011 at 9:45 pm
awesome! can we use our images? upload an image?
April 21st, 2011 at 9:36 pm
Looks great, Tim! Have you seen Ken Knowlton’s portrait of his granddaughter? Check out http://www.knowltonmosaics.com/pages/Steph.htm
July 10th, 2011 at 12:51 pm
I would like to see an updated program that takes advantage of the 24 colors that are available in M&Ms at certain mall stores and specialty shops.
August 10th, 2011 at 9:12 pm
Wow this is really good…! Very very creative of you…!
Trackbacks/Pingbacks