% Ex 5: Color processing
% This is a part of the tone-mapping workshop 
% (c) 2012 Rafal Mantiuk

img = hdrread( 'slate_mines.hdr' );
%img = hdrread( 'memorial.hdr' );

%%

img_in = img/100;

L_in = get_luminance( img_in );

L_out = L_in.^0.5;

s = 0.5;

img_out =  (img_in ./ repmat( L_in, [1 1 3] )).^s .* repmat( L_out, [1 1 3] );

imshow( cat( 2, lin2srgb( img_src.^0.5 ), lin2srgb( img_out ) ) );
