Надеюсь, это поможет:
http://www.leptonica.com/
Leptonica is a pedagogically-oriented open source site containing software that is broadly useful for image processing and image analysis applications.
Featured operations are
Rasterop (a.k.a. bitblt)
Affine transformations (scaling, translation, rotation, shear) on images of arbitrary pixel depth
Binary and grayscale morphology, rank order, and convolution
Seedfill and connected components
Image transformations combining changes in scale and pixel depth
Pixelwise masking, blending, enhancement, arithmetic ops, etc.
Example applications include
Octcube-based color quantization, with and without dithering
Modified median-cut color quantization, with and without dithering
Skew determination of text images
Segmentation of page images with mixed text and images
jbig2 unsupervised classifier
.
.
.
Как пример применеия можно использовать jbig2enc
http://github.com/agl/jbig2enc
JBIG2 Encoder с открытым кодом