osition, 0);
          channels.a = srgbLuminance(channels.rgb);
          for (var ch = 0; ch < 4; ch++) {
            let ndx = min(u32(channels[ch] * numBins), lastBinIndex);
            atomicAdd(&histogram[ndx][ch], 1u);
          }
        }

        workgroupBarrier();

        let chunksAcross = (size.x + 255) / 256;
        let chunk = workgroup_id.y * chunksAcross + workgroup_id.x;

        let ndx = local_invocation_id.y * 16 + local_invocation_id.x;
        histogramChunks[chunk][ndx] = vec4u(
 