def swap_blue_red(bs):
    """
    Swap the blue and red channels in the image.
    """
    new_bs = bytearray(bs)
    for i in range(0, len(bs), 4):
        new_bs[i] = bs[i+2]
        new_bs[i+2] = bs[i]
    return new_bs