X = imread( 'lenna256.jpg' ); % Unsigned 8-bit integer for storage
XX = double( X ); % double precision variable for floating point operations
Y = log(1+XX);
mxy = max(max(Y))
c = 255/mxy;
Z = c*log(1+XX);
mxz = max(max(Z))
imagesc( XX )
colormap( gray ( 256 ) )
axis image

imagesc( Z)
colormap( gray ( 256 ) )
axis image