code: def gray_img(img):
      """
      img: rgb image
      return: gray image, pixel values 0:255
      """
      gray = rgb2gray(img)
      if len(img.shape) == 3:
          gray = gray * 255
      return gray
  
file_path: Mozart/src/commonfunctions.py
imports: import skimage.io
  import matplotlib.pyplot
  import numpy
  from skimage.exposure import histogram
  from matplotlib.pyplot import bar
  from skimage.color import rgb2gray
  from skimage.filters import threshold_otsu, gaussian, median
  from skimage.morphology import binary_opening, binary_closing, binary_dilation, binary_erosion, closing, opening, square, skeletonize, disk
  from skimage.feature import canny
  from skimage.transform import resize
label_desc: Use image node_id 3 for calling a global function with example usage: gray_img(img) and returns: gray