function image_decimate_gray_test ( )

%*****************************************************************************80
%
%% IMAGE_DECIMATE_GRAY_TEST tests IMAGE_DECIMATE_GRAY.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    02 May 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'IMAGE_DECIMATE_GRAY_TEST:\n' );
  fprintf ( 1, '  IMAGE_DECIMATE_GRAY can "decimate" a gray scale image file.\n' );

  filename = 'casablanca.pgm';
  gray = imread ( filename );
  imshow ( gray );
  pause ( );
  [ m, n ] = size ( gray );
  fprintf ( 1, '  Original size of "%s" is %d by %d\n', filename, m, n );

  for i = 1 : 5
    gray_old = gray;
    gray = image_decimate_gray ( gray );
    imshow ( gray );
    pause ( 3 );
    [ m, n ] = size ( gray );
    fprintf ( 1, '  Size after decimation #%d is %d by %d\n', i, m, n );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'IMAGE_DECIMATE_GRAY_TEST:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
