code: def make_palette(self):
          
  
          p = array('B')
          t = array('B')
  
          for x in self.palette:
              p.extend(x[0:3])
              if len(x) > 3:
                  t.append(x[3])
          p = tostring(p)
          t = tostring(t)
          if t:
              return p,t
          return p,None
docs: Create the byte sequences for a ``PLTE`` and if necessary a
          ``tRNS`` chunk.  Returned as a pair (*p*, *t*).  *t* will be
          ``None`` if no ``tRNS`` chunk is necessary.