I heard Jonas Öberg speak about blockhash and elog.io (since mothballed) at Fosdem2015. The general purpose of these tools is to allow users to make attribution of CC licensed images easy. First they identify CC licensed images when they are used on-line, the tools then match the image with a record in a central database which provides the attribution / licence metadata: effectively meta-data becomes searchable by image. The meta-data also becomes actionable: various attribution tools, providing greater sophistication and usability, can be built as a consequence. These tools support freedom and could make our commons function better… the can also be used to make a really fun game!
Introduction to blockhash – the foundation of the game
Blockhash turns an image into a number-letter-sting (a hexadecimal hash) which is (probably) unique to that image. It reminds me a little of a barcode. You can read about the tool here, but the simplified explanation below is all that is needed to play the game.
1) An image is divided into 256 cells, by a 16 x 16 grid.
2) The “sum of all the pixels” in each cell is calculated, and so each cell is given a number.
3) The median of all the numbers is calculated. In this case it is 283.5.
4) Each cell is then given a 0 if the sum of pixels is below the the median, and 1 if it is above the median. This gives you a binary grid.
5) A hexadecimal hash is then derived from the binary. which can be used to quickly pair the image with a corresponding record in the image/meta-data archive.
How does the game work?
There are 30 or 40 images in total, distributed between some computers (we had 4 computers), saved in an otherwise empty folder. Each image has a corresponding binary-grid card with the hash at the bottom, and a photo card with the hash at the bottom too: these cards are spread out around on the floor/tables.
1) The kids work in teams to install and build blockhash on their computer
2) They switch to console mode and run the blockhash on an image to get the binary grid
3) They manually search through all the (20-40) binary-grid cards to find one which matches the one they just generated. The binary grid has the hash on the bottom. The images are spread out, the kids may start to think of ideas to help them search, for example taking a picture of the command line grid on their phone.
4) Once they have the binary grid card with the hash at the bottom, they then manually search though photo cards to find the image with the matching hash – when they find a match, they win a prize. Again, spread out the cards out so the kids have to work together and communicate to win.
5) They repeat steps 2-4 over and over and at the end, the team with the most matched cards wins! They must to use the tab function in the command line to see which images are in the file. Extra points for those who know who/what the images are of (In this case, one kid knew that this image is of Caroline Lucas from the Green Party, and was very happy to have won her!)
- Using the command line
- Using the tab key to autocomplete or suggest file names
- Using cd to change directory
- Building and running applications
- Following complex instructions carefully while under pressure
- The relationship between being careful and succeeding
- Technology can help us achieve social or political goals
- There are many many more tech heros and icons out there than Gates and Jobs (video)
- Team work – encourage this by having 2 or 3 kids per computer, getting them to take turns during the set up phrase, and spreading out the computers and game pieces so the kids have to work together to find the right cards.
Preparing for the game
Please allow plenty of preparation time, at least 2 hours for the computers and one for printing and checking the images.
Before you begin: Preparing the game pieces
The game pieces can be downloaded below. They are in sets of 10 image and hash pairs, with 40 in total. Print as many sets are you need, however, please check them before you use, there may be some errors. Additionally, the some images are culturally specific to the UK and even my town, so you may wish to omit some and add your own. Please add links in the comments box.
- Blockhash binary cards with hash set one, image cards with hex set one, images set one
- Blockhash binary set two, image cards with hex set two, images set two
- Blockhash binary set three, (did not make cards yet), images set three
- Blockhash binary set four, (did not make cards yet), images set four.
Print and laminate, put in pockets, on card or on a notice board (to stop them blowing away). Arrange the blockhashes together in once place, and images all together in another. If you have prizes to give away, they may be placed one per image.
Before you begin: Preparing the computers
Take your time here, allow at least 2 hours. It is hard to fix any errors once the game has started.
Each computer must have:
- A selection of the images arranged with one image per folder, ie documents/image1/image_1.jpg, documents/image2/image_2.jpg
- Blockhash dependencies*
Suggested steps to prepare the computers
- Update each machine with
- sudo apt-get update (debian/ubuntu) or
- sudo yum update (fedora)
- Distribute the images across the computers, one image per folder. Each image should only be used once.
- Images should be installed in the Documents folder
- Each image in a sub folder with the name “image1”, “image 2”, etc
- Only one image per folder.
- Additionally, run one of the following commands to make tab autocomplete work in the text terminal (thanks to Casualty_Report from the crunchbang IRC for help). If you re-boot you will need to run this again
- . /etc/bash_completion or
- source ~/.bashrc
- Test the instructions from start to finish, making sure everything works. Delete/purge the installed app afterwards (sudo apt-get purge libmagickwand-dev for example) so they kids still get to do the work for themselves.
*Blockhash has few dependencies, however, I found occasionally unexpected tools were missing, such as a c-compiler in one case. It is therefore best to use computers which are all running the same OS at the same version, and that you test the activity from start to finish on one machine (deleting blockhash etc before the game). If you have no errors, then you can expect all of them to function the same way. If the one machine requires some additional package then install it on the other machines too (or add the installation to the activity sheet).
Playing the game
With the kids: Video introduction
We watched the first 35 ish minutes of the following video: before the kids got restless. They did super well because the content is complex and advanced. I would have liked to make a 20 minute version but I did not have time.
You can download printable instructions here.
The kids follow these instructions on the sheet.
- In browser go to https://github.com/gingerling/blockhash
- Click the Download Zip button on the side
- Choose to save
- Open the file manager, find the zip and “extract here”
Switch off the GUI – let’s be brave!
- Click CTRL + ALT + F1 to turn it off. You will need to log in again.
Note: it’s CTRL + ALT + F7 to turn on the GUI again 🙂 We switch of the GUI so the kids can’t cheat by simply opening the file and looking at the image.
- Install image magick
- sudo apt-get install libmagickwand-dev
Change Directory into the blockhash file and build it
- In terminal go
- cd ~/downloads/blockhash-master
- Try using tab to auto-complete!
- ./waf configure
- sudo ./waf install
Getting the blockhash
Run blockhash in debug mode on the image folder: this prints the binary…
- In terminal go
- cd ~/documents/image_1 (or 2 or 3: use tab to find out what files exist)
- blockhash –debug *.jpg
How to win
- Match the binary to one of the printed cards
- Get the hash from the bottom of the card
- Match the hash to an image in the image pile – every completed image gets you a robot!
- The team to match the most images wins
- Repeat with /images2 and /images3 – use tab to find the images
It took the kids a while to understand the task, but when they did, they were super excited and ran around a lot finding images. There were a few who didn’t understand yet, who needed extra help.
If the elog.io project gets funding again in the future, I would recommend showing the kids the tool in action; using the plugin and the tools for attributing CC images. In my group this task was part of a wider dialogue about copyright.