Forum Discussion
AtticusGrove
May 26, 2025Iron Contributor
Look for a safe image to text converter for extracting text from pictures
My client sent me dozens of project details with screenshots and I have to extract text from images manually. It could be really boring and time consuming for copy and paste. I tested a few online an...
Pattismooo
May 26, 2025Iron Contributor
Powershell + Windows OCR is a good picture to text converter you can use. Windows OCR is a built-in feature in Windows 10 and 11 that extracts text from images, scanned documents, or screenshots.
Step 1: Install Required Language Packs
- Go to Settings > Time & Language > Language
- Under "Preferred languages," add your language (e.g., English)
- Click the language → Options → Download "OCR for [language]" under "Language features"
Step 2: PowerShell Script
# Load Windows OCR assembly
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
[void][Windows.Media.Ocr.OcrEngine, Windows.Foundation, ContentType = WindowsRuntime]
# Load the image
$imagePath = "C:\path\to\image.png"
$bitmap = [System.Drawing.Bitmap]::FromFile($imagePath)
# Convert to WinRT Stream
$memoryStream = New-Object System.IO.MemoryStream
$bitmap.Save($memoryStream, [System.Drawing.Imaging.ImageFormat]::Png)
$memoryStream.Position = 0
$randomAccessStream = [Windows.Storage.Streams.RandomAccessStream]::CreateFromStream($memoryStream)
# Create OCR engine
$ocrEngine = [Windows.Media.Ocr.OcrEngine]::TryCreateFromUserProfileLanguages()
if ($ocrEngine -eq $null) {
Write-Host "OCR engine could not be initialized. Check language packs."
exit
}
# Perform OCR
$ocrResult = $ocrEngine.RecognizeAsync([Windows.Graphics.Imaging.SoftwareBitmap]::CreateCopyFromBuffer(
$randomAccessStream.GetInputStreamAt(0),
[Windows.Graphics.Imaging.BitmapPixelFormat]::Bgra8,
$bitmap.Width,
$bitmap.Height,
[Windows.Graphics.Imaging.BitmapAlphaMode]::Premultiplied
)).GetAwaiter().GetResult()
# Output the text
$ocrResult.Text | Out-File -FilePath "C:\output\text.txt"
Write-Host "Text extracted to C:\output\text.txt"
Step 3: Run the Script Save as ExtractText.ps1 to extract text from images on Windows 11/10:
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
.\ExtractText.ps1
This is a free image to text converter you can use on any Windows 11 or Windows 10 computer!