Image book OCR thread

yano2mch

Professional Geeky Perv
This thread is primarily to identify and hopefully convert/fix some books that say they are epub or pdf files, but internally are nothing but sequential images. I've seen this quite a bit on Anne's Archive (and especially with certain authors), likely from screen-capping each page and slapping them into a epub/pdf and uploading it. This would result in what is a short 30-40 page story, to a 60Mb pdf/epub file.

A few instances of older books scanned and being OCR'd are a combination of automated OCR (usually with the internet archive stamp in it) while may have most of the OCR correct, is still a humongous size.

As an example, I've reduced the pages so the book is a mere 600k.... for 20 pages... (It was originally 14Mb, Some books hundreds of pages long... yeah will still push 10Mb even when compacted like this). But considering each page should be about 2k of actual content, this book/short should be ~200k.
comeinside_example.png
COME INSIDE

C hat’s it,’ Dennis says as he kneeis on the
pavers and angles the camera upwards
to make my breasts look like mountains.

ā€˜Arch your back.’

| feel like my spine’s about to snap in two, but
Dennis is the best photographer there is, so | Know the
photo’s going to be worth it. And he’s smoking hot too,
his hair so blonde it’s almost white, the muscles in his

I'd suggest if we find any that need to be worked on, we might do a request and drop them here. I have a script to reduce to the above, a 'reasonable' size but is really still far too big for it's contents; However proper OCR can make a much better epub with a bit of work, mostly finding where the OCR failed and fixing typos (which often is I, certain quotes, and sometimes lines of garbage when the OCR thinks it finds something, as well as occasionally unreadable corruption), and finally slapping it into Calibre. I'd guess you're putting 1-5 minutes per page of effort in if you decide to take up one of the books, skimming for errors or reading it and fixing it as you go.

I'd hope the fixed/finalized works can be added to the appropriate threads elsewhere.
 
Last edited:
Alright, tinkering with transparency, i think i am getting the images to where i want them.

out.png
out2.png

out4.png
out3.png



With image Magick what we want is the black/white to be a transparency rather than making a single color transparent.


So to get black (on transparent): convert image -black-threshold 101% image -negate -compose copyopacity -composite -alpha on imageout

To get White (on transparent): convert image -black-threshold 101% -negate image -negate -compose copyopacity -composite -alpha on imageout

(the first two i wasn't doing black threshold so lighting is quadratic in shades).
The actual image results are like this (left the 'image' to show; right transparency/opacity).
out4_alpha.png
 
Last edited:
Alright, got all the OCR books i had on hand done....

Now the ones i have left are ones digitized from Archive.org (these are in the Mega/OCR directory). while these are nice to have, converters i have barf on them, extracting the text takes a while, and it's not even that good of OCR work. I'd say 80%, I've seen enough errors glancing through them I'd rather start from scratch.

So unless other imgbooks come along the way that's my next half of the project. Starting with Penny Birch. These are marked 2010 (yet still have 1970's mailorder pages?), i figure some of them may even be 1970's stuff but we'll have to see, maybe it's just cheaply made.

So... Because these are all probably 200+ pages (vs the 15-30 pages i'd been doing) results may be a bit slower. I'll hope all the ones in my current todo can be done by the end of the year.

penny.jpg
 
K getting warmed up to resume. Though came across an author named Sophia Deleche. Curious, same imagebooks/imgbooks. Though, found something by accident. With the upscale the typesetter does a REALLY good job for upscaling for purposes of OCRing. Not sure if it's because i got an RTX card now, but feeding 'Fit to be Tied' through.

Darkening the text, scale down (350-400 width), upscale w/typesetter (8x, likely to 3200x???), convert to grayscale do 50/50 black/white, downscale to 1000x???, then run through OCR. Not perfect as how much the black threshold should be. But with a couple of Sophia's books i only had to make like 2 tiny fixes, the rest of the text looked damn near perfect (didn't even need to fix pipes to I's either) .

PDF -> darken (resize to 400x)-> Typesetter (resize to 1000x) -> OCR
007.jpgindex-7_1.jpgindex-7_1b.jpg
One

I stuck out my bottom, my cheeks came open and my
finger touched the little wrinkly star between: hot,
sensitive, and sticky. .

I was sticky because before putting my finger on
my bumhole I had stuck it in a large jar of honey —
Colston and Harwell’s Lincolnshire Clover, as it
happens.

Masturbation is such a joy, one of life’s greatest
and most simple pleasures. Not that the way I was
doing it was particularly simple. I’d decided how that
morning, and it had brought me a delightful, teasing
sense of anticipation for the entire day, popping into
my head at every blank moment, between lectures, in
the queue for lunch, while waiting for a student to
arrive for her tutorial. She’d been late, and I had
nearly given in and slipped a hand down the front of
my panties to satisfy what by then had become an
urgent need. I hadn’t, fortunately, as she would
undoubtedly have walked in at the exact moment I
was coming.

It was a rude and silly game. On getting back to
my flat, I locked the door, stripped from the waist
down and put my socks and boots back on. I went
about my usual tasks like that, my legs bare, my
bottom cheeks just peeping out from beneath the tails

I
 
Last edited:
A few months ago Gemma4 model came out. I wrote it off as not being useful for OCR work, but recently found that it was a pipeline of uploading an image to be badly compressed so the OCR results were useless at that time. But sending the unmodified jpeg resulted in very decent work. As such an option for OCR using an image-aware LLM is possible, though results still need to be checked and fixed, at least errors involving upscaling are probably gone for the most part... well not for really small text, those still need upscaled first...
 
Back
Top