function image_rgb_to_gray_test ( )

%*****************************************************************************80
%
%% image_rgb_to_gray_test tests image_rgb_to_gray.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    04 February 2019
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../image_rgb_to_gray' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'image_rgb_to_gray_test\n' );
  fprintf ( 1, '  MATLAB version.\n' );
  fprintf ( 1, '  Test image_rgb_to_gray.\n' );

  rgb = imread ( 'conjunction.png' );
  imshow ( rgb );
  pause ( 5 );
  equal = false;
  gray = image_rgb_to_gray ( rgb, equal );
  imshow ( gray );
  pause ( 5 );
  imwrite ( gray, 'conjunction_gray.png', 'png' );

  rgb = imread ( 'star_field.png' );
  imshow ( rgb );
  pause ( 5 );
  equal = false;
  gray = image_rgb_to_gray ( rgb, equal );
  imshow ( gray );
  pause ( 5 );
  imwrite ( gray, 'star_field_gray.png', 'png' );

  rgb = imread ( 'star_field.png' );
  imshow ( rgb );
  pause ( 5 );
  equal = true;
  gray = image_rgb_to_gray ( rgb, equal );
  imshow ( gray );
  pause ( 5 );
  imwrite ( gray, 'star_field_gray_equal.png', 'png' );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'image_rgb_to_gray_test\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../image_rgb_to_gray' );

  return
end



