stogram));
        let lastBinIndex = u32(numBins - 1);
        var channels = textureLoad(ourTexture, position, 0);
        channels.w = srgbLuminance(channels.rgb);
        for (var ch = 0; ch < 4; ch++) {
          let ndx = min(u32(channels[ch] * numBins), lastBinIndex);
          atomicAdd(&histogram[ndx][ch], 1u);
        }
      }
    `,
  });

  const pipeline = device.createComputePipeline({
    label: 'histogram',
    layout: 'auto',
    compute: {
      module,
    },
  });

  const imgBitmap = a