docs: def asrgb(self, uint8=False, alpha=None, colormap=None,
                dmin=None, dmax=None, **kwargs):
          """Return image data as RGB(A).
  
          Work in progress.
  
          """
          data = self.asarray(**kwargs)
          self = self.keyframe  # self or keyframe
          photometric = self.photometric
          PHOTOMETRIC = TIFF.PHOTOMETRIC
  
          if photometric == PHOTOMETRIC.PALETTE:
              colormap = self.colormap
              if (colormap.shape[1] < 2**self.bitspersample or
                      self.dtype.char not in 'BH'):
                  raise ValueError('cannot apply colormap')
              if uint8:
                  if colormap.max() > 255:
                      colormap >>= 8
                  colormap = colormap.astype('uint8')
              if 'S' in self.axes:
                  data = data[..., 0] if self.planarconfig == 1 else data[0]
              data = apply_colormap(data, colormap)
  
          elif photometric == PHOTOMETRIC.RGB:
              if 'ExtraSamples' in self.tags:
                  if alpha is None:
                      alpha = TIFF.EXTRASAMPLE
                  extrasamples = self.extrasamples
                  if self.tags['ExtraSamples'].count == 1:
                      extrasamples = (extrasamples,)
                  for i, exs in enumerate(extrasamples):
                      if exs in alpha:
                          if self.planarconfig == 1:
                              data = data[..., [0, 1, 2, 3+i]]
                          else:
                              data = data[:, [0, 1, 2, 3+i]]
                          break
              else:
                  if self.planarconfig == 1:
                      data = data[..., :3]
                  else:
                      data = data[:, :3]
              # TODO: convert to uint8?
  
          elif photometric == PHOTOMETRIC.MINISBLACK:
              raise NotImplementedError()
          elif photometric == PHOTOMETRIC.MINISWHITE:
              raise NotImplementedError()
          elif photometric == PHOTOMETRIC.SEPARATED:
              raise NotImplementedError()
          else:
              raise NotImplementedError()
          return data