---
# System prepended metadata

title: HOW OCR WORKS FOR EXTRACTING TEXT FROM THE IMAGES

---

# HOW OCR WORKS FOR EXTRACTING TEXT FROM THE IMAGES
![image](https://hackmd.io/_uploads/HyvuKJ2w6.png)

Nowadays, you will often hear the term OCR whenever someone talks about extracting editable text from images. The introduction of OCR has totally eliminated the need for users to manually perform text extraction from images.
However, there are still many people (including those who utilize OCR) who don’t know the exact workings of [OCR technology](https://www.hyland.com/en/resources/terminology/data-capture/what-is-optical-character-recognition-ocr) for image-to-text extraction. If you are one of those, then this guide is for you.
In this article, I am going to explain to you how OCR works, when it comes to extracting editable text from pictures.
## **What is OCR?**
![OCR](https://hackmd.io/_uploads/SJJ4OmLhT.png)
OCR is the short form of Optical Character Recognition - a pattern-matching technology that automatically extracts text from images and documents with 100% accuracy.
For example, if you scan a bank statement or receipt with a scanner, your computer will save it as an image file (PNG, JPG, etc.), meaning that you cannot edit or modify the information it contains.
Thankfully, the introduction of OCR technology has solved this issue. It quickly extracts text images in a machine-readable format which means the text will be editable, review able, and search able.
Now that I believe you will have a thorough idea about what OCR actually is, it is time to understand its working mechanism for text extraction from pictures.

## **How OCR Works for Extracting Text from Pictures**
![How OCR work](https://hackmd.io/_uploads/Hyotd7Ln6.png))
Let me clear you one thing before we head towards the working mechanism. Optical Character Recognition is just a collection of algorithms that will not be able to perform text extraction from pictures alone.
To make them work, the OCR algorithms are integrated into online tools for mobile and [desktop app](https://v2cloud.com/) that will extract data from images. This means that the work I have discussed below is in the context of OCR tools that are available on the Internet.
From what I have researched, the OCR-based tools perform image-to-text extraction in three stages that are as follows:

### 1. The Post-processing Stage:
This is the first stage in which the OCR tools will make the given picture totally black and white, while also removing all the distortions and noises from it. They do this so that the algorithms of OCR technology can efficiently scan the text that the picture contains.
### 2. Text/feature recognition stage:
After making the image black & white and removing distortion, the text recognition stage comes. Here the algorithm of [OCR tools will start analyzing the text](https://screenpal.com/image-to-text).
While scanning, they will match each letter and word with the tool’s database of words, and then extract the ones that have a successful match with the database.

### 3. The post-processing stage:
Here, the OCR tool will confirm whether the text it has extracted is 100% accurate or not. Along with this, it will also ensure the output is free from any kind of grammatical mistakes.
Let’s understand the working with a practical example so that you can get a better idea about how Optical character recognition extracts editable text from images.
I have provided a text image to an [online OCR](https://www.ocr.best/) tool. After starting the text extraction process, the tool took only a few seconds to come up with the output results. For an illustration of this, take a look at the attachment below:

![Post-processing stage](https://hackmd.io/_uploads/SkZCu78nT.png)
So, I think now you will have a good understanding of the working mechanism of OCR.
## **Benefits of Using OCR for Extracting from Pictures**
### 1. Maximum accuracy
When you perform text extraction manually, there is a strong chance that you will make mistakes, due to human nature.
For example, you may accidentally skip some letters or words, or make grammatical errors. This will not only result in inaccurate output results but also damage your reputation in front of others since your work is not good.
Thankfully, OCR technology has solved the issue of inaccuracy. With the help of advanced pattern and recognition matching algorithms, it can [extract text from pictures with 100% accuracy](https://hackmd.io/@robertjenniferr/how-ocr-technolgy-is-revolutionizing-image-to-text-conversion).
### 2. Quick Extraction
Obviously, performing text extraction will definitely require a lot of time and effort. Because you have first to take a look at the text that the given picture contains, and then write it down either in the notebook or on the computer.
But that’s not the case with OCR, it will extract all the text from the given image within seconds (you can see the picture in the working section), saving both your time and effort. This can be quite beneficial for employees who are [responsible for data extraction](https://hackmd.io/@Martin982/list-of-top-marketing-tools-for-marketers-234523earsad) from hundreds of images/invoices on a daily basis.
### 3. Text extraction from even low-quality images
This benefit is something most of you will find interesting. Extracting essential data from low-quality pictures (blurred, low-lightened, or too-lightened) can be a quite difficult task for humans, but not for OCR.
All the OCR-based tools available online have the ability to quickly and efficiently get all the text even from low-quality images. Besides this, the tool can also easily extract the text that is in any language.

## **Key Takeaways:**
Optical character recognition is a technology that automatically extracts text from images and physical documents in an editable format without compromising on accuracy.
The technology performs text extraction from pictures in three stages. In this blog, I have explained all these stages in detail along with a live demo, hope you will find them helpful. 