Re: Reverse order of bit in repeating seqence of byte string

2009-01-04 Thread Scott David Daniels
imageguy wrote: On Jan 2, 7:33 pm, John Machin wrote: For some very strange definition of "works" Well that's embarrassing ... you are correct. I need to convert from 'bgr' to 'rgb' If that is the only issue: >>> import Image >>> p = Image.open('~/VPython.png') >>> r, g, b

Re: Reverse order of bit in repeating seqence of byte string

2009-01-03 Thread John Machin
On Jan 4, 7:10 am, imageguy wrote: > On Jan 2, 7:33 pm, John Machin wrote: > > > For some very strange definition of "works". You say you have 'bgr' > > and want to convert it to 'rbg'. The following code converts 'bgr' to > > 'rgb', which is somewhat more plausible, but not what you said you > >

Re: Reverse order of bit in repeating seqence of byte string

2009-01-03 Thread imageguy
On Jan 2, 7:33 pm, John Machin wrote: > For some very strange definition of "works". You say you have 'bgr' > and want to convert it to 'rbg'. The following code converts 'bgr' to > 'rgb', which is somewhat more plausible, but not what you said you > wanted. Well that's embarrassing ... you are

Re: Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread Gary Herron
imageguy wrote: > I am looking for the most efficient method of replacing a repeating > sequence in a byte string returned from a imaging .dll, connected via > > I receive the byte string with the following sequence 'bgrbgrbgrbgr' > and I would like to convert this to 'rbgrbgrbgrbg' > FWIW, the str

Re: Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread John Machin
On Jan 3, 5:34 am, imageguy wrote: > I am looking for the most efficient method of replacing a repeating > sequence in a byte string returned from a imaging .dll, connected via > > I receive the byte string with the following sequence 'bgrbgrbgrbgr' > and I would like to convert this to 'rbgrbgrbg

Re: Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread bearophileHUGS
imageguy: > I receive the byte string with the following sequence 'bgrbgrbgrbgr' > and I would like to convert this to 'rbgrbgrbgrbg' > FWIW, the string is created using ctypes.create_string_buffer function MRAB: >  >>> a.tostring() > '210543876' That's not the required 'rbgrbgrbgrbg', but you ar

Re: Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread MRAB
Francesco Bochicchio wrote: imageguy ha scritto: I am looking for the most efficient method of replacing a repeating sequence in a byte string returned from a imaging .dll, connected via I receive the byte string with the following sequence 'bgrbgrbgrbgr' and I would like to convert this to 'rb

Re: Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread Terry Reedy
imageguy wrote: I am looking for the most efficient method of replacing a repeating sequence in a byte string returned from a imaging .dll, connected via I receive the byte string with the following sequence 'bgrbgrbgrbgr' and I would like to convert this to 'rbgrbgrbgrbg' For speed, I would l

Re: Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread Francesco Bochicchio
imageguy ha scritto: I am looking for the most efficient method of replacing a repeating sequence in a byte string returned from a imaging .dll, connected via I receive the byte string with the following sequence 'bgrbgrbgrbgr' and I would like to convert this to 'rbgrbgrbgrbg' FWIW, the string

Re: Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread Steve Holden
imageguy wrote: > I am looking for the most efficient method of replacing a repeating > sequence in a byte string returned from a imaging .dll, connected via > > I receive the byte string with the following sequence 'bgrbgrbgrbgr' > and I would like to convert this to 'rbgrbgrbgrbg' > FWIW, the st

Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread imageguy
I am looking for the most efficient method of replacing a repeating sequence in a byte string returned from a imaging .dll, connected via I receive the byte string with the following sequence 'bgrbgrbgrbgr' and I would like to convert this to 'rbgrbgrbgrbg' FWIW, the string is created using ctypes