Greg Ewing wrote, On 28/05/11 8:55 PM:
> Can anyone think of an efficient way to convert a string
> full of RGBA image data to BGRA, using only what's available
> in the standard library?

How fast is this approach compared to what you have tried?

input = cStringIO.StringIO(myrgba)
c1 = input.read(1)
while c1:
    c2 = input.read(1)
    c3 = input.read(1)
    c4 = input.read(1)
    output.write(c3)
    output.write(c2)
    output.write(c1)
    output.write(c4)
    c1 = input.read(1)
mybgra = output.getvalue()
_______________________________________________
Pygui mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pygui

Reply via email to