Glossary
OCR: reading text out of images
OCR, optical character recognition, is software that finds text in an image and converts it into characters a program can use.
How OCR works
Classic OCR runs a pipeline: clean the image (convert to grayscale, remove noise, straighten), find lines and characters, then classify each character shape. Modern engines replace the last steps with neural networks that read whole words or lines at once, which copes far better with unusual fonts and uneven spacing. Open source engines such as Tesseract and cloud OCR services from the large platforms handle scanned documents, receipts and screenshots very well.
Where scrapers use OCR
- Prices or phone numbers rendered as images to discourage copying.
- Scanned PDFs published by public bodies, a common source in data extraction work.
- Screenshots and charts that carry labels you need.
- Text based CAPTCHAs, which are a special and much harder case.
Why text CAPTCHAs beat general OCR
A text CAPTCHA is designed to be the worst possible input for OCR. Letters overlap and touch, lines cross them, the baseline waves, the background is noisy and colors vary. General engines expect clean documents, so they often split one character into two or merge two into one. Preprocessing tricks (thresholding, removing thin lines) help on simple styles and fail on the next site.
The models that do well are trained on CAPTCHA images specifically, across many styles. That is what an Image to Text task does: you send the image, and a recognition model tuned for these styles returns the characters.
Sending an image to a text task
A complete walkthrough lives in solving image CAPTCHAs in Python. The task takes the image as base64, without the data:image/png;base64, prefix. An optional module hint selects a recognition style.
import base64, time, requests
HOST = "https://gatesolver.com"
auth = dict(clientKey="YOUR_API_KEY")
with open("challenge.png", "rb") as pic:
encoded = base64.b64encode(pic.read()).decode()
ticket = requests.post(HOST + "/createTask", json={
**auth, "task": {"type": "ImageToTextTask", "body": encoded}}).json()
while True:
time.sleep(1) # image tasks: poll every second
outcome = requests.post(HOST + "/getTaskResult",
json={**auth, "taskId": ticket["taskId"]}).json()
if outcome.get("status") != "processing":
break
print(outcome.get("solution", {}).get("text"), outcome.get("errorCode"))
Answers typically come back under 1 seconds at $0.28 per 1,000 solved. Type the text exactly as returned if the site is case sensitive.
Beyond text: image classification
Many sites moved from text to picture grids ("select all traffic lights") precisely because OCR improved. Those need object recognition rather than character recognition. GateSolver handles them with separate tasks: reCAPTCHA Image Classification for reCAPTCHA grids and AWS WAF Image Classification for AWS WAF picture challenges. See the image CAPTCHA entry for the broader family.
Preparing the image
Capture the CAPTCHA picture at its natural size rather than as a scaled screenshot, and send it in its original format when you can. Cropping away surrounding page elements helps any recognizer. If the site refreshes the picture on every request, fetch the image within the same session that will submit the answer, or the text you send will belong to a different challenge.
Accessibility angle
OCR started as an accessibility technology, reading printed text aloud for people with low vision, and that remains one of its most important uses. Text CAPTCHAs (and their audio alternatives) are a known barrier for the same users, which is one reason accessibility tools are a legitimate place to apply automated recognition.
Common questions
What does OCR stand for?
Optical character recognition: software that detects text in images and converts it into machine readable characters.
Can Tesseract solve text CAPTCHAs?
Only very simple ones. Distortion, overlapping letters and noise are designed to defeat general OCR engines.
What format does an image to text task expect?
A base64 string of the image file without the data URL prefix, sent in the body field.
How often should I poll for an image task result?
Every second. Image tasks finish faster than token tasks, so a one second interval fits.
Is OCR used for picture grid CAPTCHAs?
No. Grids ask you to recognize objects, which needs image classification models rather than character recognition.
Keep reading
- Image CAPTCHAClassic warped text pictures, how OCR models read them, and the case and length details that decide a match.
- Image to Text solver$0.28 per 1,000 tasks, answers under 1 seconds.
- Solve image text CAPTCHAs in PythonDownload the distorted text image in the form session, base64 it, send ImageToTextTask and type the answer back with the right case.
- Audio CAPTCHAThe spoken alternative many widgets offer for accessibility, how it maps to the visual test, and how sites limit it.