code: def center_crop(img, size, is_color=True):
      if isinstance(img, Image.Image):
          img = np.array(img)
      if isinstance(size, (list, tuple)):
          size = size[0]
      h, w = img.shape[:2]
      h_start = (h - size) // 2
      w_start = (w - size) // 2
      h_end, w_end = h_start + size, w_start + size
      if is_color:
          img = img[h_start:h_end, w_start:w_end, :]
      else:
          img = img[h_start:h_end, w_start:w_end]
      return img
  
imports: import numpy
  import PIL
  from PIL import Image
label_desc: Use image node_id 2 for calling a global function with example usage: center_crop(img, size, is_color) and returns: img