Mona Lisa Histogram
✓ Published0🌍 Public
Mmbostock
Last edited Aug 9, 2019
Created on Jun 2, 2016
Clicking and dragging a brush across the Mona Lisa on a canvas redraws the RGB histogram beneath it. The histogram uses stacked, semi-transparent red, green, and blue area charts, with black step lines, to show color channel distributions for the selected region. The code uses d3.brush with d3.event.selection and Canvas getImageData to sample pixel values, computing histogram counts and scaling them with d3.scaleLinear before updating d3.area and d3.line paths in SVG.
AI-generated descriptiongpl-3.0 Licensed