L
Lucas L.
Hi,
I have a packed string of raw binary pixel data that I want to
manipulate. However, I'm facing a few problems.
Firstly, the only way I've managed to unpack the data so far is with
"pixels.unpack('b*')". It works great, but comes out in one massive
string.
Is there a way to:
a)put this into an array with 8 bits in each element, eg. ['00000000',
'01010101'...]
b)unpack small sections of a few bites
The other problem is that I don't know of an efficient way to manipulate
this data without having to unpack\pack massive strings each time.
Are there any solutions to these?
Thanks!
I have a packed string of raw binary pixel data that I want to
manipulate. However, I'm facing a few problems.
Firstly, the only way I've managed to unpack the data so far is with
"pixels.unpack('b*')". It works great, but comes out in one massive
string.
Is there a way to:
a)put this into an array with 8 bits in each element, eg. ['00000000',
'01010101'...]
b)unpack small sections of a few bites
The other problem is that I don't know of an efficient way to manipulate
this data without having to unpack\pack massive strings each time.
Are there any solutions to these?
Thanks!