my $bitmap = pack('H*', $out);
warn "# graphics of ",length($data)," bytes ZPL decompressed to ",length($out)," hex and ", length($bitmap), " bytes bitmap\n";
my $pw = $w * 8;
my $ph = int(length($bitmap) / $w);
print "P4\n$pw $ph\n", substr($bitmap,0,$ph*$w);
my $bitmap = pack('H*', $out);
warn "# graphics of ",length($data)," bytes ZPL decompressed to ",length($out)," hex and ", length($bitmap), " bytes bitmap\n";
my $pw = $w * 8;
my $ph = int(length($bitmap) / $w);
print "P4\n$pw $ph\n", substr($bitmap,0,$ph*$w);