Skip to content

Instantly share code, notes, and snippets.

@ereli
Created August 30, 2018 19:55
Show Gist options
  • Save ereli/82d8107b10c5d73c3ecdeeabc195b6d6 to your computer and use it in GitHub Desktop.
Save ereli/82d8107b10c5d73c3ecdeeabc195b6d6 to your computer and use it in GitHub Desktop.
scan and crop image using scanimage and convert
scanimage --mode=Color --resolution=300 > foo.pnm;convert foo.pnm -crop (convert foo.pnm -virtual-pixel edge -blur 0x15 -fuzz 15% -trim -format '%[fx:w]x%[fx:h]+%[fx:page.x]+%[fx:page.y]' info:) +repage 5.jpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment