#!/usr/bin/perl use warnings; use strict; use GD; my $width = 36; my $height = 21; my $file='images/%uh.gif'; for my $i (2..9) { my $image = GD::Image->new($width,$height); 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,$i,$red); $image->string(gdGiantFont,17,1,$i,$black); my $f=sprintf($file,$i); print "WRITE: $f\n"; open(my $fh, '>:raw', $f) or die("ERROR open $f ($!)\n"); print $fh $image->gif(); close($fh); }