-
Notifications
You must be signed in to change notification settings - Fork 248
Description
case 1)
image = np.array(Image.open(image_path).convert("RGBA"))
image_buf = cl.image_from_array(context, image, 4)
case 2)
image = np.array(Image.open(image_path).convert("RGB"))
image_buf = cl.image_from_array(context, image, 3)
for context this is shape of an array:
image = np.array(Image.open(image_path))
image.shape=(h,w,3)
case 1 works fine without error but case 2 gives back the error:
pyopencl._cl.RuntimeError: clCreateImage failed: INVALID_IMAGE_FORMAT_DESCRIPTOR
in the documentation it is mentioned that rgb is supported i have seen it also in the code of image_from_array(). Im a nooby so i tried finding the Image class to see what i am missing but i couldnt find it. Why does it need that one more byte for alpha, what am i missing. I am using PIL image.
- OS: [e.g. Linux] linux
- ICD Loader and version: [e.g. ocl-icd 2.3.1] ocl-icd 2.3.2
- ICD and version: [e.g. pocl 1.8] intel-compute-runtime
- CPU/GPU: [e.g. Nvidia Titan V]intel uhd 620
- Python version: [e.g. 3.10]3.12
- PyOpenCL version: [e.g. 2021.1]2024.3