Converting scanned text pdf to tif, background > transparen

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting scanned text pdf to tif, background > transparen

Post by fmw42 »

chrispy wrote:How can I use the convert command to convert a pdf of scanned text page with relatively white background to tif, with the background removed or transparent?
Is there a set of ImageMagick commands that will allow me to convert a multi-page pdf to a group of tiff files?

convert image.pdf -fuzz XX% -transparent white image.tif

the -fuzz finds values near white to make transparent

see

http://www.imagemagick.org/script/comma ... s.php#fuzz
http://www.imagemagick.org/script/comma ... ransparent

convert image.pdf image.tiff

will make a number of images, one for each page of pdf, e.g. image-0.tif, image-1.tif

or see

http://www.imagemagick.org/script/comma ... php#adjoin
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Converting scanned text pdf to tif, background > transparen

Post by anthony »

see techniques in IM examples, Text to Image, Postscript.

Note just replaving pure (or near pure) white with transparency is NOT a great solution as you get a halo of colors and well as loss any anti-aliased edging.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply