title: WebGL readPixels returns flipped y axis
body: <p>I have no idea why but the image that I read from canvas gets flipped on y axis.</p>
  <p>The ultimate goal is the read a portion of WebGL canvas and extract it as JPG/PNG.</p>
  <p>Workflow is the following:</p>
  <ul>
  <li>gl.readPixels</li>
  <li>create 2D canvas</li>
  <li>load Uint8Array pixels to 2D canvas as imageData</li>
  <li>get 2D canvas as blob</li>
  <li>create object URL</li>
  <li>use it as image src</li>
  </ul>
  <p>Here's my code: <a href="https://jsitor.com/acM-2WTzd" rel="nofollow noreferrer">https://jsitor.com/acM-2WTzd</a></p>
  <p>I'm really sorry about the length (almost 300) but it's WebGL, there's so much boilerplate and setup.</p>
  <hr />
  <p>I've tried to debug it for several hours and I have no idea (granted it could be the shader, I'm quite new at that).</p>
  <p>If you have any additional question, please feel free to ask!</p>