Introduction: Open Source Beer Bottle Cap Mosaic Program

My husband (programmer) and I (designer/tinkerer) were on the hunt for a project that would engage both of our skill sets. We had talked before about collaborations that would be fun for each of us and then slowly this one found us.

As we'd drink different favorite beers, we'd usually get a six-pack or a few from a specific brewery at a time and my husband started to make patterns on the kitchen table out of the first dozen caps. With mostly the same few colors, alternating red-blue-red-blue-etc. around a table centerpiece or in some grid was about as complicated as it got. As the number of bottle caps grew over time, we'd sit and share a beer while talking and making patterns when this idea hit us: what if we made mosaics out of the caps?

Making mosaic art out of bottle caps isn't our idea and there are many inspiring artists we've seen in the past few years that we've been collecting bottle caps (turns out mosaics require a TON of bottle caps, but more on that later).

The idea took many forms. Originally, I had wanted to make a Connect Four style frame and hang it in our kitchen (another day - I still think this could be tons of fun) or PLINKO style to create an image out of the caps. Eventually we landed on this incarnation where we can input any image and this program processes the image to show the types and number of bottles of beer you'd need to drink to create that mosaic. There's still a lot we want to do to create a mosaic, but for those who share a love of beer and art, this Instructable will serve to get you started on making your own mosaic!

Step 1: Phase 1: Collect Bottle Cap Images

We were surprised to find there was no comprehensive database of bottle caps when we set out. No problem! We decided we'd just take our own images of caps, but hit a snag realizing our own consumption wouldn't yield the variety necessary for interesting images. As we were out and about, we'd snap a few images of only the bottle caps and were politely asked to stop photographing the inside of several stores.

Determined to get the high quality images we were after, I wrote to our local beverage supplier's corporate office explaining our project and asking clearly for permission to a local store to take the photos. To our delight, they agreed! Just goes to show, sometimes you just have to ask for what you want. (And good manners are always a must!)

We had a nifty little setup in the aisle. There were nearly 200 unique bottle caps to capture (which was why this store was our ideal location for this project) and to make post-processing easier, we set up a simple, small process including a small tripod, a dSLR, and a flat, black background for the photos. We set each bottle down on a small target, took a photo, and moved quickly through the aisle to gather the raw images. Early on, we learned to set an identical bottle next to the upright bottle so we'd be sure to catalog the correct beer as some caps lack any identifying marks.

Step 2: Phase 2: Post Process the Images

The goals for post-processing the images were all straightforward:
1. Provide high quality images for the program output to render potential mosaics
2. Reduce any color-altering glare from the cap (hard to control lighting conditions in a retail environment)
3. Create a catalog of caps


I did this all in photoshop using a simple mask with a set diameter for the cap. Since we used a tripod, all caps were the same size in the image and this make the post work a lot easier. I also did some work with the spot healing and cloning tools to try and create an image as close as possible to the art on the cap. You can see this in the two photos included in this step.

Step 3: Phase 3: Write the Program

This is my husband's domain. All of his work is open sourced here: https://github.com/JonCoens/Photo-Mosaic

Additionally, here are some of his thoughts about the program itself:

It was the product of a couple of personal hackathons doing image processing in python. I needed to experiment with color differences in various color-spaces and experimentally settled on the existing code. Adding the hex pattern came from an idea of packing more bottle caps into the same physical space. There's plenty of areas to make the algorithm more efficient, but for the amount of time put into it I'm pleased with the results.

He tweaked the output as we looked at the initial renderings. Early on, he decided to process the image to more strongly weight the two most prevalent colors on the cap as those have the largest impact on how a cap would change the photo. He noted that two caps with say the same yellow and equal amounts of it would vary quite a bit depending on the second most apparent color and the contrast between them. These tweaks were very encouraging as we started to see sample images translate into bottle caps in more and more recognizable output.

Step 4: Future Work

This is where this Instructable concludes: image collecting and the program itself for rendering mosaics out of the images.

Once we hit this point, we realized that at the fidelity we liked, we'd need to collect thousands of bottle caps and have enjoyed finding creative ways to do this. Friends and family all save their caps for us now and my old office used to compete between the floors to see who could fill up their jars in the kitchens the fastest. We now have about 7,000 bottle caps (all cleaned!) ready and waiting. But now the next big question...what image should we build?

The program itself is at a stage of maturity that is hard to develop more without more processed images or additional insights. If you've done things in this space before, please leave comments for ways to improve!

Comments

author
RobertB15 (author)2015-01-04

Hi there,

I really love your project, the idea is great. I've downloaded your husband's program but, not being a programming expert, I have no idea how to open it.

There's a README file that I've tried to open in notepad but it wouldn't read, I was just wondering if there's any advice you or your husband could provide as to how to actually use the program?

Many thanks,

Rob.

author
acoens (author)RobertB152017-07-03

Hey RobertB15, same as the comment above, I somehow completely missed this comment - I'm so sorry!

I trust you've moved on to other projects and/or gotten the help you need but let me know if you have any follow-up questions!

author
amuravska (author)acoens2017-07-07

Hello,

I love this idea! Just sorted the bottle caps we've saved over the past 6 years while watching OISTNB last night. I am also having trouble opening the program. Please help :)

author
twocansam (author)2017-07-02

Hi, If I sent you a photo could you create me a mosaic template?

author
acoens (author)twocansam2017-07-03

Possibly, let me check!

author
rijkstofberg (author)2015-01-18

Hi there

This is truly cool!

I forked the code in Github and would love to talk to you about it. Please contact me.

Regards

Rijk

author
acoens (author)rijkstofberg2017-07-03

Gah, massive apologies Rijk! I somehow missed this message from *2 years ago*!!!

If you see this and are still interested I see about connecting you to my husband.

author
marfru (author)2014-10-09

If you were in SA would love to invite you to our bottle top project to mosaic a 30 meter x 4 meter wall http://upcycle.co.za/media/arbor-week/arbor-week.html have a check ....lol have fun with yours

author
acoens (author)marfru2014-10-09

This is terrific! I'd love to come join you if only I were a bit closer ;-)

I love the community aspect of your work.

author

This is awesome, I'm looking forward to seeing the finished product!

author

Thanks! What image would you like to see made in bottle caps?

author

I'm biased, but I'd love to see the Instructables Robot! (though the image of the golden gate bridge does look awesome too!)

author

Hah, the Robot would be great! We did a rendering of AT&T Park which came out really well but would end up being massive for something so detailed when cap = pixel. Old video game images are great for small stuff, but I'm thinking we'll do something with bold color bands to make use of the extents of our collection. We'll see!

author
JM1999 (author)2014-10-08

TTHHAANNKKYYOOUU SOOOOOO much!!!!!

I have been looking for "PLINKO" I made an instructable on it and I just couldn't find the name, you have it.

P.S. I like the mosaic :P

author
acoens (author)JM19992014-10-09

Haha glad I could help, JM1999!

author
JM1999 (author)acoens2014-10-09

You could help?!? Your paragraph was a make or break for my instructable!

I can't thank you enough.

author
scannon8 (author)2014-10-07

Wonderful work, think about doing a world of warcraft one .

author
acoens (author)scannon82014-10-07

Thanks, scannon8!

author
pi526 (author)2014-09-08

What great teamwork to make this project a reality! Absolutely no doubt that the mosaic is the Golden Gate Bridge, but thanks for posting the inspiration picture, as well. Who would've thought to get corporate permission to take photos!?! Anxious to see what you build next.

author
acoens (author)pi5262014-09-09

Thanks for the kind words, pi526! I'm exciting to nail down an image and build the mosaic, although we might need to build a cap-sorting robot to help bucket all the colors first ;-)

author
bricobart (author)2014-09-06

That's what I call determination, great job!

My logo would have been better as image, and easier ;)

author
acoens (author)bricobart2014-09-09

Thanks, bricobart!

Your logo would be excellent for this project! I feel another Instructable coming on :-)

author
mazzinga (author)2014-09-05

This is fantastic! I've been collecting since I was a kid, but never 2 of the same kind- so I think I might struggle with this program, or could you use all different types? I'm also envious of all the beers I've not tried and cool tops you have that are not in my collection- I think I need to plan a trip to the US! Here's what I made a few years back with some of mine

temp_-976786801.jpgtemp_22495622.jpg
author
acoens (author)mazzinga2014-09-05

Wow this is awesome! I like that you keep a unique collection of caps with only one of each type. You could probably set a constraint with the program to make it so each cap is only used one time (trying to match to the closest possible pixel set of the image). The only thing here is that in order to render the image ahead of time, each cap would need to be in the database which is pretty time consuming. Your method of collecting and building based on patterns seems ideal for your collection!

We've talked about adding other filters such as setting a region to the beers sampled for the image, filtering by type of drink to create a mosaic using only IPAs maybe, or by size of brewery.

author
mlegare-daust (author)2014-09-03

Is the program simple to use? I'm not programmer savvy but I would love to be able to use this. My friends have been collecting a ton of bottle caps for a table project and this would be excellent to use for it.

author
acoens (author)2014-09-02

Thanks, seamster! It's been a great learning experience so far.

author
seamster (author)2014-09-02

I've never done anything like this, but I think it's awesome. Best of luck as you continue on with this!

About This Instructable

18,534views

126favorites

License:

Bio: Designer. Thinker. Doer. Hiker. Lover.
More by acoens:Yule Log Cake DIY Solar Eclipse Viewers3D Printed Geneva Gear
Add instructable to: