use GD::Simple; my $png = GD::Image->newFromPng('test.png'); my @sw; my $pdata=''; my ($bx, $by) = $png->getBounds; my @col; # foreground colors for (0..$png->colorsTotal) { my ($r,$g,$b) = $png->rgb($_); push (@col,$_) unless ($b>128 || $r>128); } $pdata |= ~$png->wbmp($_) foreach (@col); our $zlen=int(($bx+7)/8); # number of Bytes per line my $pos=6; my $y=0; # position after Header of WBMP while ($pos