#!/usr/bin/perl -w use GD; sub round { my $x = shift; return (int($x + .5 * ($x <=> 0))); } my $j = 0; my $im = new GD::Image(130,181,1); my $color; while (<>) { chomp; my @row = split (/;/); for my $i (0..129) { my ($speed, $sail) = split (':', $row[$i+1]); $im->setPixel($i, $j, round(($speed * 100)) | ($sail << 16)); } $j++; } print $im->png();