Meta data and Archaeology: of Photos, finds and QR Codes | archaeometallurgy

Meta data and Archaeology: of Photos, finds and QR Codes

Bastian Asmus


Wouldn’t it be great if you could add  meta data to your image  files while doing the actual photographing instead of having to do this afterwards in post processing? In this two part article I present how using QR codes and tethered shooting, can achieve this goal when documenting objects. It saves a lot of time, for example, during archaeological find processing and documentation. The first part deals with the manual creation of QR codes, the second part with a script-based solution, that automates the process of adding meta data to image files.

As an archaeometallurgist I spend much – in my opinion too much – time managing image collections of archaeological samples. I’d rather spend my time writing articles, doing microscopy or analysing my data,. To that extent I dreamed for a long time of a system that would allow me to write meta data at the same time as taking my pictures. Despite all the most excellent advancements that are presented to us by projects such as  Magic Lantern,  or the Canon Hacker Developper Kit, it is to my knowledge  as of today not possible to achieve this easily (see e.g. this forum post).

Today I would like to introduce you to a solution that could be useful for archaeologists and others that have to document large sets of material photographically. The solution uses only free software, and should run on all platforms. The principle is simple: A QR code is added to the object in the photo session, this QR code is decoded by software and this is written to the meta data section of the image. The good thing: You can either do that the moment you take the photos, or later in a batch process. 

I first experimented with  handwriting recognition and tesseract OCR software, I quickly came across QR codes. QR codes (Quick Response) were originally developed for rapid mass acquiring information, or just meta data. Thus they are well suited for our purposes. The following free software is used, all can be installed for example on the Ubuntu repositories:

 Meta data, Qr codes, finds and photos

In most cases,  meta data, such as for example site, find number, and feature number to be attached to the pictures, do already exist already in a digital format, be it as Excel or Calc spreadsheet or database. During archaeological find processing the finds are usually being photographically documented along with said meta data and scale. Often it looks like this, as in this photo, i.e. with hand written label and scale. Sometimes the file name is used for elementary meta data to transport. It would then, for example, the file name: DIN95BPC160iso1.jpg. The initiated student of the material may then make sense of the meta data.

Mittelalterliches Tiegelfragment der Messingzementation.

Medieval crucible fragment of the ancient brass cementation process.

With the meta data on the label it is easy to accomplish a later identification by a student of this material. But what if you need to enter several thousand photos? Wouldn’t it  be desirable to be able to do this computerized? QR codes allow this in a quick and easy way. With the following command you can store that information in a QR code:

qrencode "Comparative_Collection ID CC15 object Collar Kosbach material Moulding loam" -o qrc.png

qrecode produces this QR code file qrc.png

This command produces a PNG file named qrc.png and looks like this. The code now contains all the necessary information and can be read by the computer. However, the readability of the agent suffers a little. With another command can change this. The imagemagick package provides an extraordinarily large amount of commands for image processing.

convert -background white -pointsize 25 -fill black -size 390 -gravity West caption:"Comparative_Collection ID cc15 object Neck ring Kosbach material Moulding loam" des.png

The convert command produces an image. The option -background white sets a white backgriund,  – point size 30 -fill black sets the font size to 30pt and the font color black, -size 390 sets the imgae width to 390px. The caption option generates a caption, the -gravity option align the text to the left (western) edge of the image. The whole thing is stored as des.png.

montage -geometry +0+0 -density 300x300 -units PixelsPerInch qrc.png des.png Qrcode_file.png

The montage command combines des.png and qrc.png, -density 300 × 300 sets a resolution of 300dpi . Finally the composite image is saved as Qrcode_file.png and looks like this. The QR code contains the meta data for the photograph, the description is for the viewer without QR decoder.


The file Qrcode_file.png looks like this. The label with QR code is machine readable and contains the specified meta data. The text makes it readble for humans, just as it has always been.

This generated label is photographed, instead of a hand written label, the resulting photograph is both machine-readable, human-readable. The advantage, in addition to the machine-readability is that these labels be created in one step from a CSV file and need not be programmed  individually. With a small command let tool zbar the QR codes can be decoded again. The command

zbarimg qrc.png

provides the following information from our QR code. Try it with your phone!

QR-Code:Comparative_Collection ID CC15 object Collar Kosbach material Moulding loam
scanned 1 barcode symbols from 1 images in 0.01 seconds

The zbar software has been developed to identify QR code in larger images. If we run the command on the image below,  zbar finds the QR code and returns the coded meta data result. The only difference is that, due to the larger image, the software takes a mite longer, and need 0.07 now.

Fragment of a reconstructed loam mould for the casting of the neck rings of Kosbach.

File cc15_0003.jpg. Fragment of a reconstructed loam mould for a neck ring. Location of the original neck ring: Kosbach (Bay).


The zbar software delivers robust results and is able to decode the QR code in  images. All the necessaries are in place  to simplify our administrative work. The second part will be about how to use these ideas to our advantage and let the computer do the work for us, using a script based solution. Read on in  the second part of this article.

As always, I welcome your feedback ….

One Response to “Meta data and Archaeology: of Photos, finds and QR Codes”

Leave a Reply

You must be logged in to post a comment.