function flattenPxls(pxls, width, height = width) {
  const out = [];
  for (let y = 0; y < height; y++) {
    for (let x = 0; x < width; x++) {
      out.push(pxls[[x, y]] || 0);
    }
  }
  return out;
}
/**
 * flattenPxls - convert pxls into flat array
 * pxls
 * width
 * height
 */
convert pxls into flat array
pxls
width
height
convert pxls into flat array pxls width height
function flattenPxls(pxls, width, height = width) {
  const out = [];
  for (let y = 0; y < height; y++) {
    for (let x = 0; x < width; x++) {
      out.push(pxls[[x, y]] || 0);
    }
  }
  return out;
}
function flattenPxls ( pxls , width , height = width ) { const out = [ ] ; for ( let y = 0 ; y < height ; y ++ ) { for ( let x = 0 ; x < width ; x ++ ) { out . push ( pxls [ [ x , y ] ] || 0 ) ; } } return out ; }
flattenPxls - convert pxls into flat array
 pxls
 width
 height
flattenPxls - convert pxls into flat array pxls width height