File: 2xpm.pl

package info (click to toggle)
xtux 0.2.030306-12
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 10,200 kB
  • ctags: 2,009
  • sloc: ansic: 11,703; makefile: 174; perl: 126; sh: 44
file content (14 lines) | stat: -rwxr-xr-x 299 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl

die "usage $0: BITMAP_FILE" unless @ARGV;

$TRANSCOLOR = "magenta";

foreach ( @ARGV ) {
	$old = $_;
	die "$old doesn't have a .bmp extension!\n" unless s/\.bmp$/.xpm/;
	rename $old, $_;
#Set transparencies
	$cmdline = "convert -transparent $TRANSCOLOR $_ $_";
	system($cmdline);
}