Library for performing document segmentation and image manipulation