[Tutor] Help: Possible to Pickle and Image?

Javier Ruere javier at ruere.com.ar
Sat Jun 4 21:17:56 CEST 2005

Aaron Elbaz wrote:
> Hi again :),
> My goal is to store an image file with lots of information relating to
> the image and the file it was extracted from, persistantly. Pickle seems
> like a really easy way to do this. So I'm wondering, is it possible to 
> serialize
> things like images into a pickle? How do I do it? If not, is there 
> another way?

   If you mean the image's file content, like file("f.png").read(), then 
yes, it can be pickled but if you mean an image object from a graphic 
toolkit then I don't know but wouldn't bet on it.
   Never the less I would recomend keeping a pointer (a path if it is 
kept in the filesystem) to the image file and storing the metadata in a 
database like SQLite.


More information about the Tutor mailing list