
use strict;

for my $type ( 'bw', 'color' ) {
	my @images = split( /\n/, `ls cropped_faces/$type/*.jpg` );
	for my $image ( @images ) {
		my $source = $image;
		my $dest = $image;
		$dest =~ s/cropped_faces/scaled_faces/;
		my $cmd = "convert -scale '24x32!' $source $dest";
		print "$cmd\n";
		`$cmd`;

		$source = $dest;
		$dest =~ s/$type/norm_$type/;
		$cmd = "convert -normalize $source $dest";
		print "$cmd\n";
		`$cmd`;
	}
}

