Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

flip-pixels

dy106.6kMIT1.0.2

Flip pixel data after readPixels

readPixels, webgl, gl, stackgl, pixels

readme

Build Status

Flip pixels after gl.readTexture:

var flip = require('flip-pixels')

var w = gl.drawingBufferWidth;
var h = gl.drawingBufferHeight
var pixels = new Uint8Array(w * h * 4);
gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, pixels);

flip(pixels, w, h)

Based on this question.

See also clip-pixels.