use warnings; use strict; use GD; my $x = 36; my $y = 21; my @arr=("2","3","4","5","6","7","8","9"); for(my $i = 0; $i <= $#arr; $i++) { my $image = new GD::Image($x,$y); my $white = $image->colorAllocate(255,255,255); my $red = $image->colorAllocate(255,0,0); my $black = $image->colorAllocate(0,0,0); $image->filledRectangle(0,0,35,20,$white); $image->string(gdGiantFont,2,1,$arr[$i],$red); $image->string(gdGiantFont,17,1,$arr[$i],$black); my $outimage = $image->gif(); open FILE,"> $arr[$i]h.gif"; print FILE $outimage; close FILE; }