def camera_callback1(image, id, vehicleId, pos): array = image.raw_data img = Image.frombytes("RGBA", (image.width, image.height), bytes(array)) img = img.convert("RGB") img.save(f"./images/{id}_{vehicleId}_{pos}.png", format="PNG")