ImageMagick convert scan: Difference between revisions
From WickyWiki
mNo edit summary |
mNo edit summary |
||
| Line 2: | Line 2: | ||
[[Category:Ubuntu Images]] | [[Category:Ubuntu Images]] | ||
[[Category:201612]] | [[Category:201612]] | ||
After scanning a document you may want to resize and compress the resulting image. You should scan with a higher resolution so you can have a better-quality lower resolution. | After scanning a document you may want to resize and compress the resulting image. You should scan with a higher resolution so you can have a better-quality lower resolution. | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
convert '*.jpg' -set filename:f '%t(resized).%e' -white-threshold 92% -resize 1500x -quality 80 | convert '*.jpg' -set filename:f '%t(resized).%e' -resize 1500x -quality 85 '%[filename:f]' | ||
</syntaxhighlight> | |||
The white paper background will probably not end up being white so we add a 'white-threshold'. A lower value will mean more light areas are converted to pure white. | |||
<syntaxhighlight lang=bash> | |||
convert '*.jpg' -set filename:f '%t(resized).%e' -white-threshold 92% -resize 1500x -quality 80 '%[filename:f]' | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Also see: | Also see: | ||
* [[ImageMagick tools]] | * [[ImageMagick tools]] | ||
Revision as of 18:24, 6 January 2017
After scanning a document you may want to resize and compress the resulting image. You should scan with a higher resolution so you can have a better-quality lower resolution.
convert '*.jpg' -set filename:f '%t(resized).%e' -resize 1500x -quality 85 '%[filename:f]'
The white paper background will probably not end up being white so we add a 'white-threshold'. A lower value will mean more light areas are converted to pure white.
convert '*.jpg' -set filename:f '%t(resized).%e' -white-threshold 92% -resize 1500x -quality 80 '%[filename:f]'
Also see: