open my $fh, '>', 'data'; binmode $fh; print $fh pack 'C*', @data; close $fh; `convert -depth 8 -size 256x256+0 gray:data data.png`;