[Tutor] using python with photoshop

Alan Gauld alan.gauld at btinternet.com
Wed Aug 21 01:51:30 CEST 2013


On 20/08/13 20:16, charles le guen wrote:

> I'm running Windows 7 64 bit and I want to manipulate psd photoshop
> files using python.

Because PSD is a proprietary (but published) format designed for 
Photoshop (although in practice many other tools can open them too)
it is always going to be a slightly clunky process.

However, if you can convert the files into more standard and open 
formats you will have more luck.

That being said I did find this with a simple Google search:

https://pypi.python.org/pypi/psd-tools

Since you don't say what you want to do I don't know if it will help...

> <http://peterhanshawart.blogspot.ca/2012/05/python-and-photoshop-code-snippets.html>
> suggesting I need to use comtypes

Never heard of comtypes but I have heard of ctypes and COM.
Both are available from Python but imply you are managing the files 
through Photoshop itself. That's usually a bad technique and a last 
resort. The psd-tools approach appears to be based on direct 
manipulation of the files.

> <http://starship.python.net/crew/theller/comtypes/> but that looks like
> dated technology. for someone working in 64bit windows 7...

COM is still supported and ctypes simply calls whatever APIs Microsoft 
(or Adobe) make available so it is as up to date as the exposed APIs...


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list