Brightness preserving image contrast enhancement using weighted mixture of global and local transformation functions