code: def test_image():
      modes = ["1", "RGB", "RGBA", "L", "P"]
      qt_format = (
          ImageQt.QImage.Format
          if ImageQt.qt_version == "6"
          else ImageQt.QImage
      )
      if hasattr(qt_format, "Format_Grayscale16"):  # Qt 5.13+
          modes.append("I;16")
  
      for mode in modes:
          im = hopper(mode)
          roundtripped_im = ImageQt.fromqimage(ImageQt.ImageQt(im))
          if mode not in ("RGB", "RGBA"):
              im = im.convert("RGB")
          assert_image_similar(roundtripped_im, im, 1)
  
imports: import pytest
  from PIL import ImageQt
  from .helper import assert_image_similar, hopper
label_desc: Use image node_id 2 for calling a global function with example usage: test_image() without return types