Written in C++, it can detect and white-out two different size logos: the standard logo and a slightly smaller version. It's decently fast. Using a quad-core processer, I was able to process 61 pages in 23 secs.
Source code is provided as GPL. Download from
http://files.aztekera.com/music/magic20090807.zip
Compare
ftp://imslp.org/logo_infested/CDSM/Cell ... 0cello.pdf
to the automated result
http://files.aztekera.com/music/bach.tiff
But what's that you say? My program can't even glob filenames? That's why I also cooked up parallelize.pl, a perl script that can parallelize any terminal command!
parallelize.pl
Code: Select all
#!/usr/bin/perl
#
# I, Eric Jiang, hereby release this script into the public domain.
#
# This script requires the Parallel::ForkManager module to run.
#
use Parallel::ForkManager;
if(scalar(@ARGV) < 3) {
print <<USAGE;
USAGE: perl parallelize.pl num cmd glob
"GLOB" is substituted with the name of each file
Example:
parallelize.pl 4 "mogrify -negate GLOB" "lol*.pbm"
USAGE
exit;
}
my @globs = <$ARGV[2]>;
my $pm = new Parallel::ForkManager($ARGV[0]);
for (my $i = 0; $i < scalar(@globs); $i++) {
$pm->start and next;
my $command = $ARGV[1];
my $currfile = $globs[$i];
$command =~ s/GLOB/$currfile/;
print($command . "\n");
system($command);
$pm->finish;
}
$pm->wait_all_children;
print "Finished ".scalar(@globs). " tasks.\n";