Forum Discussion

Damk's avatar
Damk
Iron Contributor
Nov 06, 2025

Re: Any free tool available to remove text from image or picture?

Here's a comprehensive guide to command-line approaches for removing text from images, ranging from simple automated tools to advanced AI-powered solutions.

Method 1: Using Region Based Filling

This is a very simple way to remove text from pictures.

# For text on solid backgrounds - replace specific color regions
convert input.jpg -fill "#FFFFFF" -draw "rectangle 100,100,300,150" output.jpg

# Using blur/morphology to hide text (works for small text)
convert input.jpg -morphology close square:3 -blur 0x2 output.jpg

Method 2: Python with OpenCV & Computer Vision

Create a Python script for more sophisticated text detection and removal.

#!/usr/bin/env python3
import cv2
import numpy as np
import sys
from skimage import restoration

def remove_text_simple(input_path, output_path):
    img = cv2.imread(input_path)
    
    # Method 1: Inpainting (if you know text coordinates)
    mask = np.zeros(img.shape[:2], np.uint8)
    
    # Define text region (you'll need to adjust these coordinates)
    cv2.rectangle(mask, (x1, y1), (x2, y2), 255, -1)
    
    # Use inpainting to remove text
    result = cv2.inpaint(img, mask, 3, cv2.INPAINT_TELEA)
    
    cv2.imwrite(output_path, result)

if __name__ == "__main__":
    remove_text_simple(sys.argv[1], sys.argv[2])

For simple cases: Use ImaageMagick with region blurring

For precise removal: Use OpenCV inpainting with manually defined regions

For AI-powered quality: Use Lama Cleaner or similar ML tools

For batch processing: Create wrapper scripts around any of these tools

No RepliesBe the first to reply

Resources