How to convert between NumPy array and PIL Image Ashwin Uncategorized 2014-01-162018-12-31 0 Minutes This example illustrates converting a 3-channel RGB PIL Image to 3D NumPy array and back: import numpy import PIL # Convert PIL Image to NumPy array img = PIL.Image.open("foo.jpg") arr = numpy.array(img) # Convert array to Image img = PIL.Image.fromarray(arr) Tried with: Python 2.7.3 and Ubuntu 12.04 Share this:PocketFacebookTwitterLinkedInEmailPrintRedditTelegramWhatsAppLike this:Like Loading... Related Published by Ashwin View all posts by Ashwin Published 2014-01-162018-12-31

I am working on Python project involving Tkinter and OpenCV. I stumbled on this trick you used. Thank you very much for sharing. LikeLike Reply

if i have matrix of [14965,16,32,256] where 14965 is the number of images. I want to save every image in jpg formate to use it in another project, How can i do this? LikeLike Reply

I am working on Python project involving Tkinter and OpenCV. I stumbled on this trick you used. Thank you very much for sharing.

LikeLike

if i have matrix of [14965,16,32,256] where 14965 is the number of images. I want to save every image in jpg formate to use it in another project, How can i do this?

LikeLike

Sir how do you convert .csv file into image

LikeLike

awesome, this has helped me a lot! thanks

LikeLike