use strict; use warnings; use GD; use GD::Text::Wrap; my $gd = GD::Image->new(800,600); my $white = $gd->colorAllocate(255,255,255); my $blue = $gd->colorAllocate(0,0,255); my $text = <new( $gd, line_space => 4, color => $blue, text => $text, ); $wrapbox->set_font(gdMediumBoldFont); $wrapbox->set_font('arial', 12); $wrapbox->set(align => 'left', width => 120); $wrapbox->draw(10,140); $gd->rectangle($wrapbox->get_bounds(10,140), $blue); open my $file, '>', 'outfile.jpg'; binmode $file; print { $file } $gd->jpeg; close $file;