4
4
Let's say I have a photo or scan of a text document, possibly with some low-contrast watermark background. If it is a photo, in addition to the watermark there will be brightness gradients from the lighting and possibly from the sheet of paper not laying flat due to folds.
I want to postprocess these photos with imagemagick to look like a
fax, i.e. converting the image to monochrome black/white correcting
local variations of brightness. The normal -threshold
option will
not work, since
- It doesn't automatically detect the required brightness level for each photo.
- Due to the brightness gradients the text on one part of the image may be brighter than the background on another part such that for any given global threshold some text will be lost.
Cam-Scanner apps on smartphones usually provide a black/white-document option that corrects such color gradients and calculates a reasonable first guess for the threshold value, that would suffice for batch processing.
They do not help though when I have the raw image on PC already, though I could in theory upload them to the smartphone and import them -- it is just highly impractical, especially for large numbers of images.
Does imagemagick or some other batch-processing capable software (preferably open-source) support such a conversion?
Rather than editing the links into the question, please post them as a separate answer or comment below the existing answer. Thanks. – slhck – 2015-08-19T15:54:01.933