Pictures everywhere......
So I decided I wanted to write a little script to create thumbnail images using Python and PIL so I could share some of my cooler photos with ease on some of the boards I post on. I ended up turning it into my first python script compiled as an exe using wxPython as my front end.
I wanted something that could be used by others as well, and I know lots of people like to add watermarks. Turns out some one on the board I post most frequently on wanted a copy of the tool.
Im able to process about 400 files @ 1024x768 down to 450x450 thumbs with a watermark in 50 seconds.
I can see myself doing lots of this in the future (Python GUI on windoze), lots of things I havent even explored yet either. Python executables as windows services, etc.
Nifty things from today:
* os.path.walk(start_location) rocks. If youve never used it and you need to grok a directory hierarchy it works really well. Combined with other os.path functions, I was able to retrieve and store files in a mimiced tree within about 15 miuntes. Man python is so cool!
* wxPython really neat event driven GUI. Pretty quick to get something working, but itll be awhile before I can get a hold of the whole model and use it readily.
* Pythons built in dictionary data type. Need I say more ;)
* Py2Exe allowed me to share a script with a friend that has no need to install python and bother himself with such nerdy things. Basicly, build a distutils compatible setup.py file and off you go. I had a few funky isues I had to sort thru because of the PIL module and the way it references things. Just make sure you import the Image modules your working with directly and set the __initialized__ value to 2.
Ill leave you with a screenshot of my work in progres. Please feel free to comment on my works (constructive critiscm strongly preferred), ask questions, or toss out other Python coolness in general. Ciao!
I wanted something that could be used by others as well, and I know lots of people like to add watermarks. Turns out some one on the board I post most frequently on wanted a copy of the tool.
Im able to process about 400 files @ 1024x768 down to 450x450 thumbs with a watermark in 50 seconds.
I can see myself doing lots of this in the future (Python GUI on windoze), lots of things I havent even explored yet either. Python executables as windows services, etc.
Nifty things from today:
* os.path.walk(start_location) rocks. If youve never used it and you need to grok a directory hierarchy it works really well. Combined with other os.path functions, I was able to retrieve and store files in a mimiced tree within about 15 miuntes. Man python is so cool!
* wxPython really neat event driven GUI. Pretty quick to get something working, but itll be awhile before I can get a hold of the whole model and use it readily.
* Pythons built in dictionary data type. Need I say more ;)
* Py2Exe allowed me to share a script with a friend that has no need to install python and bother himself with such nerdy things. Basicly, build a distutils compatible setup.py file and off you go. I had a few funky isues I had to sort thru because of the PIL module and the way it references things. Just make sure you import the Image modules your working with directly and set the __initialized__ value to 2.
Ill leave you with a screenshot of my work in progres. Please feel free to comment on my works (constructive critiscm strongly preferred), ask questions, or toss out other Python coolness in general. Ciao!