writeImageWithDPI

fun writeImageWithDPI(image: BufferedImage, outputFile: File, dpi: Int = DEFAULT_DPI, logSignature: String = DEFAULT_LOG_SIGNATURE)

Writes a BufferedImage to a PNG file with proper DPI metadata. This ensures Tesseract gets the correct resolution information.

Parameters

image

The image to write.

outputFile

The file to write to.

dpi

The DPI (dots per inch) to set in the image metadata.

logSignature

Signature prefix shown in logs to identify the caller context.