code: def _add_channel(self, chn, color_min, color_max):
          
          if isinstance(chn, np.ma.core.MaskedArray):
              chn_data = chn.data
              chn_mask = chn.mask
          else:
              chn_data = np.array(chn)
              chn_mask = False
          scaled = ((chn_data - color_min) *
                    1.0 / (color_max - color_min))
          self.channels.append(np.ma.array(scaled, mask=chn_mask))
docs: Adds a channel to the image object