To read data from an OpenCL image you can use this function: clEnqueueReadImage() - see documentation for more details
You can then store the data into a bmp/jpg/whatever image but that has nothing to do with OpenCL … to do that , you can use some image libraries like OpenIL or others
My question is specifically directed at what to do once you get the buffer back. For example i have written to a 1024x1024 image in my kernel and read it into an array of bytes in my c++ code.
Is this the correct way of doing it? If I have a 32 bit unsigned int rgba pixel formatted image at 1024x1024 do I just read the image into a buffer that is 4 x 1024 x 1024 and then use that as data to pack into my bitmap?
To write into an image in a kernel you have to use the function write_imageui.
Here is an example on how you can copy an image2d into another one using a kernel. (Note that that for this purpose it is better to use the clEnqueueCopyImage() into the “client” API.