code: function generatePatch(image) {
  
                      var totalPixels = image.pixels.length;
                      var patchData = new Uint8ClampedArray(totalPixels * 4);
                      for (var i = 0; i < totalPixels; i++) {
                          var pos = i * 4;
                          var colorIndex = image.pixels[i];
                          var color = image.colorTable[colorIndex];
                          patchData[pos] = color[0];
                          patchData[pos + 1] = color[1];
                          patchData[pos + 2] = color[2];
                          patchData[pos + 3] = colorIndex !== image.transparentIndex ? 255 : 0;
                      }
  
                      return patchData;
                  }
docs: create a clamped byte array patch for the frame image to be used directly with a canvas TODO: could potentially squeeze some performance by doing a direct 32bit write per iteration