1,105,320 Community Members

PIL or equivalent for saving images in Python 3.x

Member Avatar
pyguy62
Posting Whiz
346 posts since Aug 2011
Reputation Points: 23 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

Hello mates,
    I was wondering if in that vast amount of knowledge floating around here if any of you knew how I could save an image using Python 3.x. I know that PIL is a great, and easy option for Python 2, but I assume there must be some way to do this with 3. Ideas?

Member Avatar
pyguy62
Posting Whiz
346 posts since Aug 2011
Reputation Points: 23 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

In the mean time I'm committing a horrible offense by assuming the user won't mess with the location of their image files "and that they only use gifs but that's another story altogether" and doing:

###Save Image###
        contact_image={self.name1.capitalize(): self.file1}
        pics.update(contact_image)
        f=open('piclocs.dat','wb+')
        pickle.dump(pics,f)
        f.close()

where pics is a dictionary of the key "names" and their respective getfilename() locations "also know as self.file1 in this case"

Member Avatar
pyguy62
Posting Whiz
346 posts since Aug 2011
Reputation Points: 23 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

are jpg images completely unsupported for tkinter without PIL?

Member Avatar
pyTony
pyMod
6,103 posts since Apr 2010
Reputation Points: 818 [?]
Q&As Helped to Solve: 1,056 [?]
Skill Endorsements: 42 [?]
Moderator
Featured
 
0
 

You could store uncompressed bmp by the class that is in my mandelbrot snippet.

There does indeed seem to be unofficial PIL existing for Python3: http://stackoverflow.com/questions/3896286/image-library-for-python-3 (as well as some alternatives)

Member Avatar
pyguy62
Posting Whiz
346 posts since Aug 2011
Reputation Points: 23 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

Do you know how to set this up?

Member Avatar
pyTony
pyMod
6,103 posts since Apr 2010
Reputation Points: 818 [?]
Q&As Helped to Solve: 1,056 [?]
Skill Endorsements: 42 [?]
Moderator
Featured
 
0
 

Until now I have been satisfied to code for PIL in Python 2

Member Avatar
pyguy62
Posting Whiz
346 posts since Aug 2011
Reputation Points: 23 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

Well if you do ever get one of these up and running let me know how you did it, it looks like I might need to compile the C files or something along those lines

Member Avatar
pyguy62
Posting Whiz
346 posts since Aug 2011
Reputation Points: 23 [?]
Q&As Helped to Solve: 19 [?]
Skill Endorsements: 0 [?]
 
0
 

For all searching for this I found a GREAT source for Python 3 PIL with easy installation and confirmed operational http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil

Test notes:
running on windows vista
running in tkinter on python 3.2.2
jpeg support confirmed using ImageTk.PhotoImage

Question Answered as of 2 Years Ago by pyTony
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: