code: def rgb2gray(arr):
      # return shape is 2d of (y, x)
      return np.dot(arr[..., :3], [0.299, 0.587, 0.114])
  
file_path: nnabla/python/src/nnabla/utils/image_utils/backend_events/pypng_backend.py
imports: from __future__ import absolute_import, division
  import numpy
  import png
  from nnabla.logger import logger
  from .common import upscale_pixel_intensity, check_type_and_cast_if_necessary, _imread_before, _imread_after, _imsave_before
  from .image_utils_backend import ImageUtilsBackend
label_desc: Use image node_id 2 for calling the PngBackend obj's underlying member method code with example usage: obj.rgb2gray(arr) and returns: np