write Image With DPI
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.
output File
The file to write to.
dpi
The DPI (dots per inch) to set in the image metadata.
log Signature
Signature prefix shown in logs to identify the caller context.