Per un progetto casa ho bisogno di tracciare (x, y) le coordinate su una bitmap 400x400 in bianco e nero.Perl: metodo consigliato per tracciare (x, y) pixel in bitmap monocromatica
Quale modulo perl si consiglia e quale formato di immagine (GIF ?, PNG? Altro?) Sarebbe più facile da gestire su OS X, Windows, Linux?
EDIT La mia soluzione, basata su GD, come consigliato da Brian Agnew
use strict;
use warnings;
use GD;
my $BitMap = GD::Image->new(400,400);
my $white = $BitMap->colorAllocate(255,255,255);
my $black = $BitMap->colorAllocate(0,0,0);
# Frame the BitMap
$BitMap->rectangle(0,0,399,399,$black);
# Transparent image, white background color
$BitMap->transparent($white);
# plot some, just to show it works #
for my $x (0..100) {
for my $y (0 .. 100) {
$BitMap->setPixel(250+100*sin($x)-$y,150+125*cos($x)+$y,$black);
}
}
# write png-format to file
open my $fh,">","test.png" or die "$!";
binmode $fh;
print $fh $BitMap->png;
close($fh);