#!/usr/bin/perl use strict; use Cwd; use Carp; use GD; my $jpeg_quality=90; my $content = `date`; my $out = sprintf "/tmp/out.jpg", time; my $image1 = new GD::Image(200,250); my $red = $image1->colorAllocate(255,0,0); my $white = $image1->colorAllocate(255,255,255); $image1->fill(0,0,$white); $image1->string(gdSmallFont,2,2,$content,$red); open(DATEI ,'>', $out) || die "could not write image: +$!"; binmode DATEI; print DATEI ($image1->jpeg($jpeg_quality)); close(DATEI); warn "saved $out\n";