oneocr / _archive /attempts /create_test_image.py
OneOCR Dev
OneOCR - reverse engineering complete, ONNX pipeline 53% match rate
ce847d4
"""Create test image with text 'ONE OCR DZIAŁA!' for OCR testing."""
from PIL import Image, ImageDraw, ImageFont
# Create white image
img = Image.new("RGB", (600, 150), color="white")
draw = ImageDraw.Draw(img)
# Try to use a good font, fallback to default
try:
font = ImageFont.truetype("arial.ttf", 48)
except OSError:
try:
font = ImageFont.truetype("C:/Windows/Fonts/arial.ttf", 48)
except OSError:
font = ImageFont.load_default()
# Draw black text
draw.text((30, 40), "ONE OCR DZIALA!", fill="black", font=font)
img.save("image.png")
print("Created image.png with text 'ONE OCR DZIALA!'")