Gamera document preprocessing toolkit