Last active
August 29, 2015 13:56
-
-
Save saintedlama/9038786 to your computer and use it in GitHub Desktop.
Enhance camera "scanned" documents with gm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gm = require('gm'); | |
if (process.argv.length != 4) { | |
console.log('Usage: enhancescan input output'); | |
process.exit(2); | |
} | |
var input = process.argv[2]; | |
var output = process.argv[3]; | |
gm(input) | |
.type('Grayscale') | |
.level(40, 1, 120) | |
.write(output, function (err) { | |
if (err) { return console.log(err); } | |
console.log('Enhanced scan written to', output); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment