code: def test_mono_image(blank_hocr, outdir):
      im = Image.new("1", (8, 8), 0)
      for n in range(8):
          im.putpixel((n, n), 1)
      im.save(outdir / "mono.tif", format="TIFF")
  
      hocr = hocrtransform.HocrTransform(
          hocr_filename=str(blank_hocr), dpi=8
      )
      hocr.to_pdf(
          out_filename=str(outdir / "mono.pdf"),
          image_filename=str(outdir / "mono.tif"),
      )
      # shutil.copy(outdir / 'mono.pdf', 'mono.pdf')
      check_pdf(str(outdir / "mono.pdf"))
  
file_path: OCRmyPDF/tests/test_hocrtransform.py
imports: from __future__ import annotations
  import re
  from io import StringIO
  import pytest
  from pdfminer.converter import TextConverter
  from pdfminer.layout import LAParams
  from pdfminer.pdfdocument import PDFDocument
  from pdfminer.pdfinterp import PDFPageInterpreter, PDFResourceManager
  from pdfminer.pdfpage import PDFPage
  from pdfminer.pdfparser import PDFParser
  from PIL import Image
  from ocrmypdf import hocrtransform
  from ocrmypdf._exec.tesseract import generate_hocr
  from ocrmypdf.helpers import check_pdf
  from .conftest import check_ocrmypdf
label_desc: Use image node_id 3 for calling a global function with example usage: test_mono_image(blank_hocr, outdir) without return types