Curious coder recreates girls portrait using only black dice

first_imgBy day, Scott MacDonald works at Zymeworks which is helping to fight disease through the creation of molecular simulation technology. By night, he’s a hacker with an active imagination and curiosity to see what problems can be solved with code.One of his recent projects may come in handy if you are looking for a truly unique Christmas gift for a friend or relative. He managed to hack together a program that takes in image data and outputs a version that can be recreated using only dice.To prove his dice system worked, he took a picture of someone called Caroline (we assume he knows her) and reproduced her portrait using only black dice with white pips on them. The end result is great as you can see from the images, and would surely be met with a smile if presented framed as a gift to Caroline.The actual method of converting an image to a configuration of dice is pretty simple. First Scott downscaled the color photo to a 6-step gray palette so as to map to the six sides of the dice. The side with one white pip represents black, where as 6 pips is white. Everything in between is counted as a shade of gray.The output of the program is an on-screen representation of the image in dice. If you’re happy with the end result you can then take the next step of buying lots of dice and recreating the image by hand. Scott managed to find a place that sells dice in bulk, and he needed to as the representation of Caroline required 2,560 dice.The good news is, Scott has shared the code that does the image conversions on his website (link below). However, if you intend to try this yourself for your own image, be warned that the final result is going to weigh a lot and you’ll need a very sturdy frame to hold it (and a few friends to help carry it). The Caroline dice image is said to weigh close to 100 pounds. I also imagine it’s going to take many hours of work to put together.One thing Scott didn’t account for is the effect of allowing the dice to be rotated, something that could allow for a higher resolution output. That has been brought up in the comments on his original post though, and he may improve upon the program when he gets chance.Get the code and view more images at the elusive snark. Scott’s project also encouraged someone else to try the same image conversion using Photoshop.last_img read more

Read More