code: def brightness_to_opacity(image):
      assert image.shape[-1] == 3
      brightness = np.apply_along_axis(
          lambda x: np.linalg.norm(x, ord=2), axis=-1, arr=image
      )[..., None]
      brightness = np.minimum(1, brightness)
      image = np.divide(
          image,
          brightness,
          out=np.zeros_like(image),
          where=(brightness != 0),
      )
      return np.concatenate([image, brightness], axis=-1)
  
file_path: lucid/lucid/scratch/rl_util/util.py
imports: import numpy
  import tensorflow
  import scipy.ndimage
  import lucid.optvis.render
  from lucid.misc.io.collapse_channels import hue_to_rgb
label_desc: Use image node_id 8 for calling a global function with example usage: brightness_to_opacity(image) and returns: np