upgrade histogram building
added luminance output