Get image from image.raw_data

Hello, because carla image objects are too big for my use case, i tried to save only the image.raw_data. When I try to save the images I get wrong images. What am I doing wrong?
add to cueue:
carla_image_data_array = np.ndarray(
shape=(image_rgb1.height, image_rgb1.width, 4),
dtype=np.uint8, buffer=image_rgb1.raw_data)
sensor_queue.put((carla_image_data_array, image_rgb1.frame, name1))
read image:
def sensor_callback_raw(image, frame, name):
cv2_img = cv2.cvtColor(image, cv2.COLOR_BGRA2RGB)
cv2.imwrite(f"_{name}/%04d.{imagetag}" % frame, cv2_img)
0440