code: function DecodeFrameType6(frameData, width, height, palFile) {
      var colors = new Uint8Array(width * height * BYTES_PER_PIXEL);
      var setPixel = getPixelSetter();
  
      // TODO: ?? investigate where this is coming from
      var headerSizeSkip = 10;
  
      var j;
      for (var i = headerSizeSkip; i < frameData.length; /*i++*/) {
          var chunkSize = frameData[i++];
          if (chunkSize & 0x80) {
              // Regular (colored) chunks.
              chunkSize = 256 - chunkSize;
  
              if (chunkSize <= 65) {
                  for (j = 0; j < chunkSize; j++) {
                      setPixel(colors, palFile.colors[frameData[i++]]);
                  }
              } else {
                  // Run-length encoding (repeat the same color).
                  chunkSize -= 65;
                  var color = palFile.colors[frameData[i++]];
                  for (j = 0; j < chunkSize; j++) {
                      setPixel(colors, color);
                  }
              }
          } else {
              // Transparent chunk.
              for (j = 0; j < chunkSize; j++) {
                  setPixel(colors, TRANSPARENT_COLOR);
              }
          }
      }
  
      return {
          width: width,
          height: height,
          colors: colors
      };
  }
docs: Type6 corresponds to an image with arbitrary color / transparency data.
  Both transparent and color data use run-length encoding for compression.
  
  1). Read one byte (chunkSize).
  2). If chunkSize >= 128:
  - Subtract chunkSize from 256
  2a). If chunkSize <= 65, read that many bytes.
  - Each byte read corresponds to a color index in the palette.
  - Set the pixel color to this color.
  2b). Else (chunkSize > 65), subtract 65 and read one byte.
  - The byte corresponds to a color index in the palette.
  - Set chunkSize # of pixels to this color.
  3). Else (chunkSize < 128):
  - Set chunkSize # of transparent pixels.
  4). Repeat from 1 till end of frame data.