We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

PIL or equivalent for saving images in Python 3.x

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?

2
Contributors
7
Replies
1 Week
Discussion Span
1 Year Ago
Last Updated
9
Views
Question
Answered
pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 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"

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

are jpg images completely unsupported for tkinter without PIL?

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 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)

pyTony
pyMod
Moderator
6,312 posts since Apr 2010
Reputation Points: 879
Solved Threads: 987
Skill Endorsements: 26

Do you know how to set this up?

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

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

pyTony
pyMod
Moderator
6,312 posts since Apr 2010
Reputation Points: 879
Solved Threads: 987
Skill Endorsements: 26

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

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 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

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0
Question Answered as of 1 Year Ago by pyTony

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0735 seconds using 2.66MB