Inspired by mapbox/rio-hist (python), this demo showcases pure-JS, client-side, Histogram Matching.
Implementation based on scikit-image (doc and code) which simply relies on numpy bincount, cumsum, interp.
scikit-image and numpy use BSD3 License ([1] and [2]).
writeArrayBuffer supports Color Spaces other than RGB (namely HSL, HSV, XYZ, LAB, LCH) based on Qix-/color-convert. Execution ~10x slower for RGB, so used original implementation in that case SOURCE
TARGET
MATCHED OUTPUT