Skip to content

Vision OCR 1.14.0 — skipped blocks of text are now read, and spot colour is kept

Choose a tag to compare

@charlesapetersen charlesapetersen released this 26 Sep 04:27
· 293 commits to main since this release

Scanned pages printed with a spot colour keep it. A page with a red rule, a coloured banner or a
colour photograph on a page of type was published in grey, because only pages with a lot of colour
overall kept theirs. Automatic now also keeps colour when enough of the sheet itself is coloured,
ignoring a coloured scanner border. Across the test library 100 pages keep their colour this way, at
about 7% more bytes each.

Scanned pages where whole blocks of text could not be selected are now read in full. Vision, given a
whole page at once, sometimes skips entire paragraphs of clean type; on a six-page 1951 journal scan about
half of each page had no text layer. When a page comes back with inked areas that have no words over them,
it is now read again in overlapping strips and the missing lines are added, and a line the first reading
found is not added a second time. On that document the selectable words went from 2,075 to 3,526. Pages
read fully the first time cost almost nothing extra; pages that needed the second reading took about three
seconds longer each, and so may a page with a picture on it (BUGS.md C30).

Short born-digital pages keep their exact text, and a low-resolution scan with an old text layer is read
again instead of kept as it was.
A part title, half-title or nearly blank page with only a few words of
real text used to be turned into a picture and re-read. It is now kept as it is, provided nothing on it
could be a picture: no image, pattern, note or outlined lettering. A short page that does carry one of
those is still re-read, and the run report now names it. The other half of the fix matters more. The test
for "this page is already a picture" missed scans under 900 pixels wide and scans whose image is written
inline. When such a scan carried an earlier OCR layer, it was taken for a born-digital page, kept with its
old text, and never read by the app. Pages whose text is mostly invisible are now always re-read (BUGS.md C29).

A mixed PDF — born-digital pages among scanned ones — now keeps the compact page compression for its
scanned pages.
Until now, one page kept as it is turned that compression off for the whole file, and the
layered-image saving with it, so a mixed file came out much larger: measured on a ten-page book with a
born-digital first page, 1.4 MB instead of 0.4 MB, and nine tenths of that difference was the layering rather
than the compression itself. The kept page is now put back into the compressed document instead of the
document being rebuilt the old way. Two files still take the old, larger route, deliberately: one that has
bookmarks, because the step that puts the page back cannot carry a bookmark tree across, and one with a
highlight or a note of your own on a born-digital page, because that page arrives already carrying the mark
and copying it again would put two there. Both come out correct, only larger. Measured over the 42 such
documents in the test corpus: 16 have bookmarks and 4 have a mark of their own on such a page, so 22 are
refused for neither reason (BUGS.md C29).

A page that already has real text of its own is now kept as it is, instead of being turned into a picture
and re-read.
This is the fix for the report described in the next entry. Making a mixed PDF searchable used
to rebuild every page as an image, so a born-digital cover sheet or title page came out carrying OCR of a
picture of its own words — American Sociological Association became AMFAKAN FOCAX ONCAL ASSOXUTION, and a
search that worked on the original failed on the copy. Such pages are now copied through untouched: their
text, their fonts and their colour images arrive exactly as they were, and the report says which pages were
kept as well as which were not; what is measured is the page's text, character for character, not its fonts
or its image streams. Scanned pages are rebuilt as before — re-reading those is what the app is for — with
one caveat that is a limitation rather than a promise: the test for "already a picture" needs the page's
image to be at least 900 pixels wide and drawn as a normal XObject, so a very low-resolution scan, or one
whose image is written inline, can be mistaken for a born-digital page and kept with its old OCR instead of
being re-read. Two more limits (the first of which the entry above now removes for most files): a mixed file is written
with the older, larger page compression and loses the layered-image saving with it, so it can come out
noticeably bigger; and a short born-digital page — under
about two lines of text — is still rebuilt, because two lines is the bar the app uses to tell a real page of
text from a plate or a part title (BUGS.md C29). (The first caveat, for scans with an old invisible text
layer, and the short-page limit are both removed by the short-page entry above.)

The run report now tells you when a page that already had real text of its own was turned into a picture
and re-read.
Some PDFs are a mixture: a library or a publisher puts born-digital pages — a download cover
sheet, a title page, sometimes whole chapters — in front of or among scanned ones. Making such a file
searchable rebuilds every page as an image and recognises it, so on those pages exact text is replaced by
OCR of a picture of that text, and a phrase you could previously search for may no longer be found. That
happened silently: the page count is right and the file has a text layer, so nothing looked wrong. The
report now names those pages, with the complete count first. Measured over the 233-document test corpus,
392 pages in 42 documents are of this shape, and on 38 of the 42 nothing else in the app mentions it at all
— including one 300-page book of which 167 pages are born digital (BUGS.md C29). This is a report and not
yet a fix: those pages are still rebuilt — the entry above is the fix, and it landed in the same unreleased
batch, so on a page of two lines or more this note now names pages that were kept rather than pages that
were lost. Pages that only ever carried OCR text are deliberately not
reported — re-reading those is what the app is for.

A page with unrecognised words on it is no longer treated as a page of nothing but text. When every
mark on a page is text the recogniser boxed, both tone layers are stored at an eighth and a sixteenth of
the page's resolution — which is the right thing to do, and was being done to pages that also carried
type the recogniser had missed. Words present in your scan then survived only in that shrunk
background, illegible, and in no text layer either. The layering decision now also asks whether the ink
outside the recognised words is shaped like lines of type, at the page's own type scale, and keeps the
resolution when it is (BUGS.md C28). Measured over the corpus: about 18 pages in 16,987 stop being
shrunk, for roughly 2.7 MB more output in total, and 13 of the 16 pages measured losing content keep it.
No page loses anything it kept before — the change can only ever store a page at more resolution than
it did, never less. Three pages that lose only a hand-made mark — a pencilled annotation, an inked
margin number — are still not covered, and one of those is invisible to this signal for a reason
recorded in the register.

"Smallest files" no longer promises that nothing is lost from your photographs. The setting's
description used to end "though nothing is lost from them", and that is measurably untrue: on a
scanned page whose small print falls outside the words the recogniser boxed, a third of the
resolution can be the difference between legible and not (BUGS.md C28 — a printed correlation matrix
whose last column reads at half resolution and does not read at a third). The clause is gone and
nothing replaced it; the rest of the description is unchanged, and nothing about what the setting
does has changed.

The run report now names the pages whose non-text ink was stored at an eighth. On a page whose
ink is all recognised text, both tone layers are shrunk hard — and anything the recogniser missed
on such a page lives only in that shrunk background. Measured over the whole population
(BUGS.md C28): of the 73 corpus pages the shipped bar still treats this way, sixteen lose content.
Until now nothing said which pages those were, on any run. A batch that publishes such a page now
writes one line into its run report naming the pages and how much of each page's ink fell outside
the recognised words — for example scan.pdf: 3 page(s) were read as holding nothing but recognised text, so the rest of the page was stored at an eighth — anything the recogniser missed on them is degraded: p4 (2.1% of its ink); p6 (0.0% of its ink); p7 (0.0% of its ink)

Every such page is named, with no threshold on that fraction: the same campaign showed that the
pages which lose content and the pages which do not cannot be told apart by it, and one page
measured losing a pencilled annotation reads 0.0%. The conversion still succeeds and the file is
still whole — this reports the degradation, it does not yet prevent it.


Requires macOS 13 (Ventura) or later, on an Apple Silicon or Intel Mac. Drag Vision OCR onto Applications. The app is not notarized, so the first launch needs System Settings ▸ Privacy & Security ▸ Open Anyway. Control-click ▸ Open no longer works on current macOS.