Image display from database

Hi guys
I would like to display pulled from a database on an image on a Vision window. I understand I can do this with a paintable canvas component.
I have read “all” the posts on this forum and tried most options.

I suspect that my image blob is not correct format.
I am generating the image via an OpenCV python script. Database is MariaDB, column type is blob.
When I pull it out in Ignition the datatype is either ndArray (numPy) or unicode.
I have deduced (perhaps incorrectly) that neither of these is correct.

Has some one done this successfully?
Precisely what format do I need to generate in my python script?

Any help would be appreciated.

OOPS!

I would like to display “AN IMAGE” pulled …

I've successfully displayed .jpg files in a paintable canvas from a database after slightly tweaking this code.

Thanks Zacht
That works great for images stored on client machine

But, my images are on the gateway, so that’s the reason I stored images in database

I have identified my issue: the format in which the image is stored.

So the solution is to use PIL (Python Imaging Library) to convert the OpenCV array to bytes, using the function ‘fromarray()’ function before storing the result in the database.

Hope this helps anyone else using OpenCV

Thanks