Saturday, October 13, 2012

TILT (Text to Image Linking Tool)

Visualising links between image and text on the Web is one thing, but how do you create them in the first place? Unless you have a lot of spare time on your hands and don't get bored easily you may find the available tools aren't up to much. For example, the Harpur poems come in the form of manuscript anthologies, 70-100 pages in length. Even if you restricted yourself to just one link per line it would take quite a while to define image maps using a tool like the Gimp image-map plugin. One ordinary-looking manuscript page from the Harpur collection took me more than one hour, and that was without defining any links to the text. The British Library edition of the Codex Sinaticus looks good, but cost millions of dollars to make (reportedly). There has to be a better way.

What I needed was a simple tool that would truly facilitate an essentially tedious task, and leave me with data in a form I could use. One clear requirement was for the definition and editing of polygonal areas, not just rectangles. Polygons are a must, if anything that is not strictly rectilinear happens in a text, for example a correction, or even if the paper was slightly curved when it was photographed. Since the available manual methods were all much too slow, I decided to write my own tool.

Try defining rectangles on a per-line basis here

There are two current tools that are freely available. One is the Text-Image alignment tool in TextGrid. Although it works quite well it is entirely manual, and it doesn't offer automation. It's also tied in with TextGrid, Eclipse and XML. I didn't want to use any of these. TILE on the other hand is written in Javascript, which would allow it to be usable over the Web. But it appears to be unfinished. Also there is doubt that a program of this complexity can be built quickly enough, and be sufficiently stable and robust using only web-languages. So I decided to use good old Java. This gave me plenty of power, stability, and a single language to develop in. After a few days coding I have nearly exceeded the capabilities of TILE. It can also be turned into an applet, so it can be used on the Web.

So far TILT can define rectangles and polygons on top of a resizable image. Either type of shape can be selected, deleted, moved, scaled and edited by dragging control points. The background image can be also reduced to black and white to facilitate automatic word and line selection. This should be easy to achieve with the image-handling facilities of Java.

I also have to add linking with the text, saving in HTML and JSON formats, and uploading to the server. But all of these are easy to do.

2 comments:

fotis said...

TextGrid offers also a module to link text with images.
I have difficulties to understand why the fact, that Tile doesn't support your needs (either in features or rubustness), takes you back to square one. Starting from scratch makes only sense if nothing from the other tool is useful.

desmond said...

I already had a look at the TextGrid module but I forgot to mention it in the blog entry. I'll fix that. TILE is unfinished and it doesn't do polygons. The Editing Modernism in Canada people recently tried and failed to use TILE for their project. (See https://github.com/DGI-EMiC/Emic-Tile).
The Textgrid module is OK functionally but for us it raised three problems. Firstly, it is Eclipse-based and we had to develop a web solution because it says that on the grant. Secondly it doesn't have any automation, which TILE tried to do. If you are defining regions on many pages you need automatic word and line selection or you'll go crazy. Thirdly it is based on XML, and we are building an XML-free toolset for the humanities. In addition, having control over the way that the module fits into the overall HRIT (humanities resources infrastructure and tools) system is an advantage for us.