#!/usr/bin/perl # Compute all the new file names foreach $file (@ARGV) { print "Skipping non-.pnm file $file...\n" and next unless $file =~ /\.pnm$/; $newfile = $file; $newfile =~ s/\.pnm$/-2.pnm/; # Skip if new file exists print "$newfile already exists. Skipping...\n" and next if -e $newfile; # Create a copy of the file for mogrify to work on... system "cp $file $newfile"; push @newfiles, $newfile; } die "Can't continue -- no files to convert!\n" unless @newfiles; # Increase the contrast, increase the brightness by 25%, and then sharpen $" = " "; system "mogrify -contrast -modulate 25 -contrast -sharpen 20 @newfiles"; # Now make a movie with Berkeley mpeg_encode my $paramcode = join '',; print "Output movie file: "; $outname = ; chomp $outname; $" = "\n"; $inputfiles = "@newfiles"; $paramcode =~ s//$outname/s; $paramcode =~ s//$inputdir/s; $paramcode =~ s//$inputfiles/s; open PARAM, ">paramfile.param"; print PARAM $paramcode; close PARAM; system "mpeg_encode paramfile.param"; unlink 'paramfile.param'; __DATA__ # parameter file template with lots of comments to assist you # # you can use this as a template, copying it to a separate file then modifying # the copy # # # any line beginning with '#' is a comment # # no line should be longer than 255 characters # # # general format of each line is: #