# Extracting tiles from a tileset programatically?

How do I programatically extract tiles from a tileset such as this one: http://opengameart.org/sites/default/files/grassland_tiles.png

I want to use these tiles in my game. I see that some tiles here are of different sizes (or maybe all tiles are a multiple of some fixed size). For example, if I want to use one of the tree tiles in my program, how can I figure out what offset into the tileset image I must use, and how big of a sub-image i must extract? I don't see any metadata associated with any of these tilesets that I can use.

Thanks!

Its got one .txt several .tmx files. The .tmx files seem to describe the location of specific items in the atlases.