code: def get_masked_image(page, bbox, selected_bboxes):
      pix = page.get_pixmap(dpi=settings.TEXIFY_DPI, clip=bbox)
      png = pix.pil_tobytes(format="PNG")
      png_image = Image.open(io.BytesIO(png))
      png_image = mask_bbox(png_image, bbox, selected_bboxes)
      png_image = png_image.convert("RGB")
      return png_image
  
imports: import io
  from copy import deepcopy
  from functools import partial
  from typing import List
  import torch
  from texify.inference import batch_inference
  from texify.model.model import load_model
  from texify.model.processor import load_processor
  import re
  from PIL import Image, ImageDraw
  from marker.bbox import should_merge_blocks, merge_boxes
  from marker.debug.data import dump_equation_debug_data
  from marker.settings import settings
  from marker.schema import Page, Span, Line, Block, BlockType
  import os
label_desc: Use image node_id 3 for calling a global function with example usage: get_masked_image(page, bbox, selected_bboxes) and returns: png_image