This package contains various image processing methods which are useful for preprocessing page images for OCR. It also contains several commands in the cmd/ directory which can be used to preprocess images directly.

This is a Go package, and can be installed in the standard go way, by running go get and documentation can be read with the go doc command or online at

If you just want to install and use the commands, you can get the package with git clone, and then install them with go install ./... from within the preproc directory.


There are several commands in the cmd/ directory which are useful in their own right as well as serving as examples of using the package.


The integral image operations don’t produce exactly the same result as their non-integral image counterparts. The difference is small enough that it has little effect on the output images, but it ought to be identical.


Any and all comments, bug reports, patches or pull requests would be very welcomely received. Please email them to


This package is licensed under the GPLv3. See the LICENSE file for more details.