Repository navigation
How to easy process images previous to OCR? #1674
Unanswered
Disonantemus
asked this question in
Q&A
Replies: 1 comment
|
There is no built-in ImageMagick hook via CLI only — custom preprocessing needs a plugin (your link #923 is correct), which does require a little Python. But for your case (colored charts / boxes / textures) you can usually skip the manual pdfimages + magick roundtrip with the built-in flags: What each does:
Two notes on your CONS:
If those flags still do not match your manual magick result, the plugin route is the only way to inject an arbitrary |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
I have many documents with images that contain raster images with useful information (like many kinds of charts: organizational, flow, statistics, etc), but images are very different, with many colors/sizes/quality, that get bad results with OCR.
Workaround
Right now, I do:
pdfimages -all in.pdf _imagemagick, Example: remove all colors but black (text color) very useful to clean charts/boxes with colors/textures that don't get OCRed):magick in.png -alpha remove -fill white -fuzz 70% +opaque "#000000" -colorspace gray out.pngocrmypdfI do get a lot better OCR from that (better than use
ocrmypdfflags process images).Alternative
I know is possible to do a plugin, because #923 , but I don't know how to do that. I'm not a programmer.
Question
There is an easy way to process image(s) inside a PDF with
imagemagick(CLI, no python) to manual improve OCR in hard cases?All reactions