function image_double_gray_test ( )

%*****************************************************************************80
%
%% IMAGE_DOUBLE_GRAY_TEST tests IMAGE_DOUBLE_GRAY.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    02 May 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'IMAGE_DOUBLE_GRAY_TEST:\n' );
  fprintf ( 1, '  IMAGE_DOUBLE_GRAY can "double" a gray scale image file.\n' );
  fprintf ( 1, '  Here, we start with a file that has been halved 3 times.\n' );
  fprintf ( 1, '  We double it three times, examining each result.\n' );

  filename = 'casablanca8.pgm';
  gray8 = imread ( filename );
  imshow ( gray8 );
  [ m, n ] = size ( gray8 );
  fprintf ( 1, '  Image size of "%s" is %d by %d\n', filename, m, n );
  pause ( 5 );

  gray8x2 = image_double_gray ( gray8 );
  imshow ( gray8x2 );
  [ m, n ] = size ( gray8x2 );
  fprintf ( 1, '  Size after doubling #1 is %d by %d\n', i, m, n );
  filename = 'casablanca8x2.pgm';
  imwrite ( gray8x2, 'casablanca8x2.pgm', 'encoding', 'ascii' );
  pause ( 5 );

  gray8x4 = image_double_gray ( gray8x2 );
  imshow ( gray8x4 );
  [ m, n ] = size ( gray8x4 );
  fprintf ( 1, '  Size after doubling #2 is %d by %d\n', i, m, n );
  filename = 'casablanca8x4.pgm';
  imwrite ( gray8x4, 'casablanca8x4.pgm', 'encoding', 'ascii' );
  pause ( 5 );

  gray8x8 = image_double_gray ( gray8x4 );
  imshow ( gray8x8 );
  [ m, n ] = size ( gray8x8 );
  fprintf ( 1, '  Size after doubling #3 is %d by %d\n', i, m, n );
  filename = 'casablanca8x8.pgm';
  imwrite ( gray8x8, 'casablanca8x8.pgm', 'encoding', 'ascii' );
  pause ( 5 );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'IMAGE_DOUBLE_GRAY_TEST:\n' );
  fprintf ( 1, '  Normal end of execution.\n' );

  return
end
