GD::Imageでピクセルカウンターみたいなのを作って白ピクセルを数えてみた。
#!/opt/local/bin/perl -w
use strict;
use GD::Image;for my $file (@ARGV){
my $pxcount = 0;
my $wpxcount = 0;
my $img = GD::Image->newFromPng($file);
my ($w,$h) = $img->getBounds();
my $white = ($file eq 'terada.png') ? '252253252' : '255255255';for my $x (0..$w){
for my $y (0..$h){
$pxcount++;
$wpxcount++ if $white eq join '', $img->rgb($img->getPixel($x, $y));
}
}printf "$file:\t%.2f\%\t%d\t%d\n", ($wpxcount / $pxcount) * 100, $pxcount, $wpxcount;
}
$ perl hoge.pl mixi.png
mixi.png: 69.69% 2733060 1904632
$
ちなみにみんなが大好きなはてなのトップページは
$ perl hoge.pl hatena.png
hatena.png: 58.85% 623170 366708
$
30分ほどレトリックを駆使して説得したにも関わらず全く翻意する様相が無い。