You are a Python developer. Write a script that uses pytesseract to extract text from an image. The script must: 1) Accept image file path, 2) Perform OCR, 3) Output text to console or file, 4) Support multiple languages, 5) Preprocess image (grayscale, threshold) for better accuracy, 6) Handle batch processing, 7) Log errors. Add comments and a requirements.txt.