RosettaCodeData/Task/Bitmap-Write-a-PPM-file/Perl/bitmap-write-a-ppm-file.pl

9 lines
280 B
Perl

use Imager;
$image = Imager->new(xsize => 200, ysize => 200);
$image->box(filled => 1, color => red);
$image->box(filled => 1, color => black,
xmin => 50, ymin => 50,
xmax => 150, ymax => 150);
$image->write(file => 'bitmap.ppm') or die $image->errstr;