How OCR Reads Text from Images
How Optical Character Recognition works, the Tesseract engine, accuracy factors, preprocessing tips, and real-world OCR applications.
Inpainting is the art and science of restoring missing or damaged parts of an image. Whether it is removing a distracting power line from a landscape or erasing a photobomber from a vacation memory, the goal is the same: to fill the gap so seamlessly that a viewer never suspects anything was ever there.
Our brains are natural inpainters. Every human has a "blind spot" in their retina where the optic nerve attaches, yet we don't see a black hole in our vision. Our brain constantly "hallucinates" the missing information based on the surrounding colors and patterns.
When we look at a photo with a missing piece, we don't just see a void; we see what should be there. If a fence is partially blocked, we know the rails continue behind the obstruction. AI inpainting attempts to replicate this cognitive leap using mathematical models.
The evolution of object removal has moved from manual labor to automated intelligence:
The LaMa model is currently the state-of-the-art for "object removal" tasks. Unlike older models that only looked at the pixels immediately touching the hole, LaMa looks at the entire image at once.
The secret sauce of LaMa is the Fast Fourier Transform (FFT). Standard neural networks process images like a magnifying glass, looking at small neighborhoods of pixels. LaMa converts the image into the frequency domain, which allows it to see repeating patterns (like the texture of a brick wall or the ripples in water) across the entire frame instantly.
You may notice that many AI tools work best on specific square regions. This is because neural networks have a fixed "input resolution" they were trained on—usually 512×512 or1024×1024 pixels.
To handle a high-resolution 20-megapixel photo, the software doesn't feed the whole image into the AI at once. Instead, it identifies the area you want to change, crops a 512px patch around it, lets the AI fill the gap, and then carefully "blends" that patch back into the original high-res file.
AI inpainting is a master of plausibility, not necessarily accuracy. It doesn't know what was actually behind the object; it just knows what "looks right."
Modern web technology like ONNX Runtime Web and WebAssembly (WASM) allows these massive ML models to run directly on your computer's hardware through the browser.
The trade-off is the initial download. A high-quality inpainting model like LaMa is roughly 200 MB. Once downloaded, it is cached by your browser, making subsequent uses near-instant.
AI inpainting doesn't just "erase" an object; it performs a digital hallucination, calculating the most statistically probable reality to fill the void you've created.
How Optical Character Recognition works, the Tesseract engine, accuracy factors, preprocessing tips, and real-world OCR applications.
The math behind semi-transparent watermarks, why fixed patterns can be reversed with zero quality loss, and the difference between visible and invisible watermarks.
Why screens mix red, green, and blue light, what HEX shorthand really encodes, and when HSL makes your life easier.