code: def mask_bbox(png_image, bbox, selected_bboxes):
      mask = Image.new("L", png_image.size, 0)  # 'L' mode for grayscale
      draw = ImageDraw.Draw(mask)
      first_x = bbox[0]
      first_y = bbox[1]
      bbox_height = bbox[3] - bbox[1]
      bbox_width = bbox[2] - bbox[0]
  
      for box in selected_bboxes:
          # Fit the box to the selected region
          new_box = (
              box[0] - first_x,
              box[1] - first_y,
              box[2] - first_x,
              box[3] - first_y,
          )
          # Fit mask to image bounds versus the pdf bounds
          resized = (
              new_box[0] / bbox_width * png_image.size[0],
              new_box[1] / bbox_height * png_image.size[1],
              new_box[2] / bbox_width * png_image.size[0],
              new_box[3] / bbox_height * png_image.size[1],
          )
          draw.rectangle(resized, fill=255)
  
      result = Image.composite(
          png_image, Image.new("RGBA", png_image.size, "white"), mask
      )
      return result
  
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 2 for calling a global function with example usage: mask_bbox(png_image, bbox, selected_bboxes) and returns: result