13

Starting with Acrobat 9, Adobe engineers added a new flavor of OCR called ClearScan.

The advantages of the ClearScan over Searchable Image OCR are both in size and clarity. The biggest innovation of Clearscan is that:

ClearScan does not replace the font with your system fonts. Rather, a custom font it is created to match the visual appearance of the pixels.1

Are there other products than Adobe's that support Clearscan or similar products that use a custom font that is created to match the visual appearance of the pixels?

3
  1. Smoothscan is a tool to convert scanned text into a vectorized output form. Because printed text is assembled from fonts, each particular letter (like ‘o’) will have the same shape as every other ‘o’ in the document. We can take advantage of this, by building a table of such symbols, and represent each occurrence of a symbol with a reference to that symbol’s table entry. This will save a lot of space, and a similar idea is used in djvu’s jb2 mode and JBIG2 for PDF.

    smoothscan builds up this table, but instead of filling the table with the original raster images, it vectorizes each symbol. Vector images will look smoother than their raster equivalents, and can be scaled without introducing pixelation. These properties result in a smaller output file size, as well as making the scanned text images more readable.

    smoothscan saves the vectorized images into a custom TrueType font and embeds the font into the output pdf file. Currently each symbol is mapped to an arbitrary letter in the font, but in future versions you could run OCR on each symbol, and ensure that the ‘o’ image is associate with the ‘o’ character encoding in the generated font.

    A search of pkgs.org returns no smoothscan package for any Linux distro. So it needs to be compiled from the source code, its README notes these dependencies:


    On a Ubuntu box, most of these can be had like so:

    apt install libleptonica-dev libhpdf-dev potrace python-fontforge
    

    A test with a sample picture. Load the README in abiword, print it to a .ps file, and then...

    • Use ghostscript to convert that .ps file to .tif,
    • convert that to monochrome .tif, (the only input smoothscan accepts)
    • run smoothscan
    • compare the various file sizes with wc -c:

      gs -sDEVICE=tiffg4 -o README.tif README.ps
      convert -monochrome README.tif README.mono.tif
      smoothscan -o README.pdf README.mono.tif
      wc -c README README.ps README.*tif README.pdf | head -n -1
      

    Output:

      2432 README
     83516 README.ps
     33707 README.tif
     33618 README.mono.tif
     20394 README.pdf
    

    First paragraph of resulting README.pdf, showing vectorized fonts:

    image of first smoothscan paragraph, showing vectorized fonts.

  2. The djvu file format includes a JB2 option, which is much the same thing as ClearScan.

    Using the above README.ps input, the any2djvu util returns excellent results with:

    any2djvu README.ps
    

    ...the resulting README.djvu is only 7K, (1/3 the size of smoothscan's output), and looks sharper:

    any2djvu image of first two lines of README.djvu

    That sharpness is probably helped by not using a monochrome .tiff as input. That test is an unfair comparison. Let's try it with the mono rasterized .tiff:

    # "-f 6" sets input format to "Scanned Document - B&W - >400 dpi"
    any2djvu -f 6 README.mono.tif
    

    Now the output is less than 6k, but looks a bit jaggier:

    enter image description here

    Unlike smoothscan's .pdf output, the .djvu output allows text selection, even with rasterized input.

    One bad thing however, any2djvu needs an online server to do the conversion work -- it's not a suitable tool for confidential documents.

  • Thanks for the nice post, I thought that there were no alternatives but it seems there are rather good ones +1/accepted – Eduard Florinescu May 14 '16 at 11:44
  • Very nice answer, but... Did you say you converted the PS file to DJVU? Wasn't the Postscript file already vectorized and with selectable text? – Andrea Lazzarotto May 15 '16 at 0:08
  • Whether the .ps file was vectorized or rasterized, I dunno, it's whatever abiword prints out to (since the .ps file is 85K, which is even bigger than the .tif, I'd guess it's rasterized). I'm unhappy with the present PS>DJVU any2djvu test though, and am still looking for ways to test djvu against rasterized text. – agc May 15 '16 at 17:59
  • Is smoothscan still supported? The latest commit on the git is dated in 2013, 5 years ago – rtrtrt Oct 12 '18 at 12:59
  • In hindsight, using sample text that included the name of the first program makes the djvu entry more confusing... – agc Oct 12 '18 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.