def METHOD_NAME(img):
    """ This only saves the rgb channels of the image
    """
    imgformat = img.format()
    if imgformat == "bgra32":
        bgr = img.bmp_array[:, :, :3]
        rgb = bgr[:, :, ::-1].copy()
        pil_img = Image.fromarray(rgb, "RGB")
        with tempfile.TemporaryDirectory() as tmpdir:
            path = os.path.join(tmpdir, 'img.bmp')
            pil_img.METHOD_NAME(path)
    else:
        raise NotImplementedError(
            "currently only supports writing out bgra32 images"
        )