in reply to bitmap and pack
I thought only '1' or '.' were acceptable to set or not set the pixels?
pack template 'b', only considers the low bit of each byte, thus all these produce the same results:
print unpack 'b8', pack 'b8', '01010101';; 01010101 print unpack 'b8', pack 'b8', 'babababa';; 01010101 print unpack 'b8', pack 'b8', "\x00\x01\x00\x01\x00\x01\x00\x01";; 01010101 print unpack 'b8', pack 'b8', "()()()()";; 01010101 print unpack 'b8', pack 'b8', "@?@?@?@?";; 01010101 print unpack 'b8', pack 'b8', 'dcdcdcdc';; 01010101
|
|---|