{"slug": "i-highlight-paper-books-a-small-open-model-types-my-quotes-while-i-sleep", "title": "I highlight paper books. A small open model types my quotes while I sleep", "summary": "A developer built Dogear, an open-source app that photographs highlighted pages in paper books and, in a nightly batch job, extracts the highlighted passages using a small open-weight model (Gemma 4 e4b via Ollama) plus Tesseract OCR running on a plain CPU. Testing showed that handing whole page photos to the model found only 1 of 3 passages and produced false quotes, so the pipeline was redesigned to use Lab color-space detection with a fitted paper-tint surface to locate highlights, letting the model read crops while the code decides what counts as a quote. On two test pages the pipeline found 3 of 3 passages with no false quotes, and 4 of 6 quotes had both readers agreeing.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady](https://dev.to/challenges/hacktoberfest-week3-2026-10-19).*\n\nI read on paper, with a highlighter in hand. Every quote that stops me ends up in a Notion database: knowing I'll keep what I mark makes me read more carefully, writing it down helps me remember it, and later I can find the right line when it comes up in a conversation or in something I'm writing.\n\nThe chore is in between: sitting down with the book, finding each highlighted passage again and typing it word by word. By the end of a book I have dozens of highlighted lines and no will to copy them.\n\n**Dogear** removes that chore. While reading, the only extra thing I do is take a photo of each page I highlighted. Overnight, a small open-weight model running on a plain CPU in the cloud reads the photos and pulls out exactly the highlighted passages. In the morning I review them and stay in full control: I can keep, edit or delete any quote, and add one the night run missed. What I keep stays in my library, and a Notion export is next.\n\nDogear works end to end today: I photograph a page from the app, the night run reads it, and the quotes wait for me in the morning. What's still ahead lists what comes next.\n\n**Try it:** [dogear-web.onrender.com](https://dogear-web.onrender.com). Anyone can sign in and start their own library. Page photos are read by the next nightly run (06:00 UTC) and deleted afterwards.\n\nThe video walks through the whole loop with public-domain books. The screens are the real app with demo data, and the quotes and crops come from Dogear's own pipeline (Tesseract and Gemma 4 on a CPU) run on a page of *Pride and Prejudice*. The night-run numbers are a real line from the Render log.\n\n**Photograph the pages you highlighted in a paper book. Overnight, a small open-weight model on a plain CPU types out exactly the highlighted passages. In the morning you review them.**\n\n[Live app](https://dogear-web.onrender.com) · [Demo video](https://youtu.be/X18GtpoFXyM) · [API reference](https://github.com/teofurlan/dogear/docs/api.md)\n\nBuilt for the [DEV Hacktoberfest Open-Source AI Challenge, Week 3: Slow and Steady](https://dev.to/challenges/hacktoberfest-week3-2026-10-19).\n\nReading on paper with a highlighter is great; copying the highlights out afterwards is not. Dogear moves that chore to a night job and keeps you in charge of the result:\n\nBefore writing any app code, I tested the riskiest assumption with three real photos taken on my lap, one-handed. In a phone photo, a highlighter barely changes the paper: its color saturation measured about 7 out of 255, which is basically gray.\n\nWhat worked was the Lab color space, which separates brightness from color. Instead of looking for a particular color, the code measures how far each pixel drifts from the paper's own tint, so it doesn't care which pen I picked. Light was the next trap: with half a page in shadow, one paper tint no longer fit the whole photo. The fix was to fit the tint as a smooth surface across the page and compare each pixel with the tint at its own position. That found every highlighted block on my test pages.\n\nMy first plan was to hand the whole photo to Gemma 4 (`e4b`, running in Ollama) and ask for the highlighted text. On one page it found 1 of 3 passages. On the other, it confidently returned the chapter title, which isn't highlighted at all. Given only a crop, it read well, but once it silently dropped a whole clause. A quote app that drops words is worse than no app.\n\nSo the design flipped: **the model reads, the code decides.**\n\nOn my two test pages, the pipeline found 3 of 3 passages on each, with no false quotes. Watching Gemma fail taught me two fixes: send crops shaped like a text selection instead of scattered word boxes, and compare readings in a way that forgives OCR's glued words and the page's line-break hyphens. In the end, 4 of the 6 quotes came out with both readers agreeing, and the other 2 were flagged, exactly where OCR scrambled the text near the book's gutter. No wrong quote was presented as confident.\n\nNone of this has to happen when I take the photo, so it doesn't. A nightly cron job on Render processes the day's photos on a plain CPU, with no GPU. The model weights are baked into the Docker image, and a page takes about a minute and a half on four CPU cores, so even a heavy reading day of 30 pages is done in under an hour, long before I wake up. The job first ran on an 8 GB instance for about 2.5 cents, but Gemma peaked near 7.4 GiB there, so it moved to 16 GB for about a cent more per night.\n\nAround the pipeline, I built a FastAPI server and a React PWA:\n\nThe full loop works: library, page capture, night run and morning review. Next come search by meaning across my quotes, the Notion export, deleting a book together with its quotes, and a dedicated in-app camera.\n\n**Before:** in a dense book, I highlight 2 or 3 passages per page. Copying them is a 30 to 60 minute typing session, so I keep postponing it, and the quotes pile up in books I've already shelved.\n\n**After:** one photo per highlighted page, taken while the book is still open, and a short review over breakfast. The review screen now exists, so I'll measure the real review time over the next books I read.\n\n`e4b` reads every highlighted block, cross-checked against OCR.", "url": "https://wpnews.pro/news/i-highlight-paper-books-a-small-open-model-types-my-quotes-while-i-sleep", "canonical_source": "https://dev.to/teo_furlan/i-highlight-paper-books-a-small-open-model-types-my-quotes-while-i-sleep-4197", "published_at": "2026-10-25 04:33:04+00:00", "updated_at": "2026-10-25 04:42:20.989629+00:00", "lang": "en", "topics": ["ai-tools", "computer-vision", "large-language-models", "ai-products", "developer-tools"], "entities": ["Dogear", "Gemma 4", "Ollama", "Tesseract", "Notion", "Render", "DEV Hacktoberfest"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/i-highlight-paper-books-a-small-open-model-types-my-quotes-while-i-sleep", "markdown": "https://wpnews.pro/news/i-highlight-paper-books-a-small-open-model-types-my-quotes-while-i-sleep.md", "text": "https://wpnews.pro/news/i-highlight-paper-books-a-small-open-model-types-my-quotes-while-i-sleep.txt", "jsonld": "https://wpnews.pro/news/i-highlight-paper-books-a-small-open-model-types-my-quotes-while-i-sleep.jsonld"}}