title: Drawing ImageBitMap/Image to OffScreenCanvas in a web-worker
body: <p>I have a vue.js application where I set up vue-workers/web-workers to perform some image processing(scaling/cropping) in the background after a user uploads a couple images. </p>
  
  <p>I decided to go with ImageBitMpas &amp; OffScreenCanvas since Canvas and Image Object is not supported in web workers. I can create an ImageBitMap from my image file using CreateImageBitMap() method. It successfully returns a promise and then resolves to an ImageBitMap. I can print it to my console and see the ImageBitMap gets created! I added a picture of the ImageBitmap printed to the console below.</p>
  
  <p><a href="https://i.stack.imgur.com/ioGgw.png" rel="nofollow noreferrer">ImageBitmap is created and error is thrown</a> </p>
  
  <pre><code>var loadingImage = new Image();
  loadingImage.onload = () =&gt; {
  
      console.log(createImageBitmap(loadingImage)); // I can see the ImageBitmap logged to console
      const canvas = new OffscreenCanvas(100,100);
      const ctx = canvas.getContext('2d');
  
      Promise.all([
          createImageBitmaps(loadingImage);
      ]).then(function(result){
          console.log("printing promise resolved");
          console.log(result);
          ctx.drawImage(result,0,0,200,200);  /// &lt;-- this is where error is thrown
      })  
  
      // other code here .... 
  
  };
  loadingImage.src = base64Src; 
  </code></pre>
  
  <p>Question:
  Where I am having trouble is when I pass this ImageBitMap to the OffScreenCanvas.draw() method I get an error saying "failed to execute drawImage on OffscreenCanvasRenderer..." You can see the exact error in the console after the ImageBitMap is printed in the picture below.</p>
  
  <p>Has anyone successfully drawn an image to an OffScreenCanvas in a vue-worker/web-worker? Any Example of working code would be greatly appreciated! </p>
  
  <p>Also from my research, it seems like createImageBitMap() is only supported in Chrome?! Is there another way instead of using ImageBitMap to draw to OffScreenCanvas that will work on both chrome and Safari???</p>