Created
August 2, 2024 18:54
-
-
Save danhorst/20304edd8bcfd83da0652b73836253b5 to your computer and use it in GitHub Desktop.
Convert a picture of a document to a "scanned" image
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
| #!/usr/bin/env ruby | |
| Dir.glob("src/*").each do |file| | |
| destination = file.split("/").last | |
| cmd = "magick #{file} -resize \"1000>\" -colorspace Gray -fill white -tint 120 -normalize PNG8:#{destination}" | |
| puts cmd | |
| `#{cmd}` | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment