code: def should_visible_page_image_use_jpg(pageinfo: PageInfo) -> bool:
      """Determines whether the visible page image should be saved as a JPEG.
  
      If all images were JPEGs originally, permit a JPEG as output.
  
      Args:
          pageinfo: The PageInfo object containing information about the page.
  
      Returns:
          A boolean indicating whether the visible page image should be saved as a JPEG.
      """
      return bool(pageinfo.images) and all(
          im.enc == Encoding.jpeg for im in pageinfo.images
      )
  
imports: from __future__ import annotations
  import logging
  import os
  import re
  import sys
  from collections.abc import Iterable, Iterator, Sequence
  from contextlib import suppress
  from pathlib import Path
  from shutil import copyfileobj, copystat
  from typing import Any, BinaryIO, TypeVar, cast
  import img2pdf
  import pikepdf
  from PIL import Image, ImageColor, ImageDraw
  from ocrmypdf._concurrent import Executor
  from ocrmypdf._exec import unpaper
  from ocrmypdf._jobcontext import PageContext, PdfContext
  from ocrmypdf._metadata import repair_docinfo_nuls
  from ocrmypdf.exceptions import DigitalSignatureError, DpiError, EncryptedPdfError, InputFileError, PriorOcrFoundError, TaggedPDFError, UnsupportedImageFormatError
  from ocrmypdf.helpers import IMG2PDF_KWARGS, Resolution, safe_symlink
  from ocrmypdf.hocrtransform import DebugRenderOptions, HocrTransform
  from ocrmypdf.hocrtransform._font import Courier
  from ocrmypdf.pdfa import generate_pdfa_ps
  from ocrmypdf.pdfinfo import Colorspace, Encoding, PageInfo, PdfInfo
  from ocrmypdf.pluginspec import OrientationConfidence
label_desc: Use image node_id 21 for calling a global function with example usage: should_visible_page_image_use_jpg(pageinfo) and returns: unknown