code: function copyImageData (imageData) {
      var
        height = imageData.height,
        width = imageData.width,
        data = imageData.data,
        newImageData, newData, i;
  
      canvas.width = width;
      canvas.height = height;
      newImageData = context.getImageData(0, 0, width, height);
      newData = newImageData.data;
  
      for (i = imageData.data.length; i--;) {
          newData[i] = data[i];
      }
  
      return newImageData;
    }
docs: Type Conversion