Convert Image Text to Normal Text Easily with Python I Image To Text with Python Code I

Опубликовано: 05 Октябрь 2024
на канале: Only solutions
69
3

Convert Image Text to Normal Text Easily with Python I Image To Text with Python Code I Copy Text From Image I Image To Text Conversion Using Python - Easy

I have explained In detailed in Hindi on how to use Python code to copy text from Image it might be PNG or JPG or JPEG or JFIF etc..
Use this to simplify your work :)

To download pytesseract : https://pypi.org/project/pytesseract/

Formula:
import pytesseract as tess
tess.pytesseract.tesseract_cmd = r'path\tesseract.exe'
after putting Path you will use \ and write either tesseract.exe or tesseract which ever shows you.
from PIL import Image
img = Image.open('Sample.png')
text = tess.image_to_string(img)
print(text[:-1])

Note: img = Image.open('Sample.png') in brackets you will use your file name and make sure it has same name space else it will show you error.

#Python
#Image to Text With Python Code
#Copy Text From Image