function image_normalize_test ( )

%*****************************************************************************80
%
%% image_normalize_test() tests image_normalize().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 August 2024
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../image_normalize' )

  pkg load image;

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

  filename1 = 'stallone1.jpg';
  A1 = imread ( filename1 );
  [ h1, w1, colors1 ] = size ( A1 );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Input file is "%s"\n', filename1 );
  fprintf ( 1, '  Height = %d, Width = %d, Colors = %d\n', h1, w1, colors1 );

  h2 = 120;
  w2 = 90;
  A2 = image_normalize ( filename1, h2, w2 );

  colors2 = 1;
  filename2 = 'stallone2.jpg';
  imwrite ( A2, filename2, 'jpeg' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Output file is "%s"\n', filename2 );
  fprintf ( 1, '  Height = %d, Width = %d, Colors = %d\n', h2, w2, colors2 );
  
  figure ( 1 )
  imshow ( A1 )
  title ( filename1 )

  figure ( 2 )
  imshow ( A2 )
  title ( filename2 )
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'image_normalize_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../image_normalize' )

  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

