added minimum brightness (val). Added 'sidebar' for text and histograms