Grayscale histograms with a mask