use GD;$f='#ffffff';$T=table;sub p{print@_}p"
";for(@ARGV){ open*G,$_ or(warn("$_: $!")&&next);$g=GD::Image->newFromGif(G)||(warn$_, ": GD error"and next);@c=map{$_!=$g->transparent?sprintf'#'.('%.2x'x3),$g-> rgb($_):$f}0..$g->colorsTotal;p"<$T border=0 cellpadding=0 cellspacing=0>";( $x,$y)=$g->getBounds;for$j(0..$y){p"