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

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