function image_contrast_test ( )

%*****************************************************************************80
%
%% image_contrast_test() tests image_contrast().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 February 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../image_contrast' );

  timestamp ( )
  fprintf ( 1, '\n' );
  fprintf ( 1, 'image_contrast_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test image_contrast().\n' );

  gray = imread ( 'surfsup.png' );
  gray_new = image_contrast_gray ( gray, 0.25 );
  filename = 'surfsup_contrast_0.25.png';
  imwrite ( gray_new, filename, 'png' );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
  figure ( 1 )
  imshow ( gray_new )

  gray_new = image_contrast_gray ( gray, 5.00 );
  filename = 'surfsup_contrast_5.00.png';
  imwrite ( gray_new, filename, 'png' );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
  figure ( 2 )
  imshow ( gray_new )

  rgb = imread ( 'underwater_bmx.png' );
  rgb_new = image_contrast_rgb ( rgb, 5.0 );
  filename = 'underwater_bmx_contrast_5.00.png';
  imwrite ( rgb_new, filename, 'png' );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
  figure ( 3 )
  imshow ( rgb_new )

  rgb_new = image_contrast_rgb ( rgb, 10.0 );
  filename = 'underwater_bmx_contrast_10.00.png';
  imwrite ( rgb_new, filename, 'png' );
  fprintf ( 1, '  Graphics saved as "%s"\n', filename );
  figure ( 4 )
  imshow ( rgb_new )
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'image_contrast_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( )

  rmpath ( '../image_contrast' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

