[Tutor] using python with photoshop

charles le guen charlesleguen at gmail.com
Wed Aug 21 04:01:10 CEST 2013


Gimp is indeed an option.  I might use nuke as well (it opens psd files).
But I think I figured out how to manipulate photoshop with python...

Seems installing
pywin32<http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/>
does
the trick.  It's important to install the proper version (I run 6 bit
windows 7 but I had 32 bit version of python installed so the version of
pywin32 needed to be the 32 bit version).

Once pywin32 is installed, this code (below) opens photoshop:

from win32com.client import Dispatch
psApp = Dispatch("Photoshop.Application")

>From here, I'll figure out how to manipulate layers etc as well.

thanks
C



On Tue, Aug 20, 2013 at 4:33 PM, Albert-Jan Roskam <fomcl at yahoo.com> wrote:

>
>
> ________________________________
> > From: charles le guen <charlesleguen at gmail.com>
> >To: tutor at python.org
> >Sent: Tuesday, August 20, 2013 9:16 PM
> >Subject: [Tutor] using python with photoshop
> >
> >Hi
> >
> >I'm running Windows 7 64 bit and I want to manipulate psd photoshop files
> using python.
> >
> >Google searches led me to a few cool sites suggesting I need to use
> comtypes but that looks like dated technology. for someone working in 64bit
> windows 7...
> >
> >Can anyone tell me the best way to manipulate photoshop with python?  Is
> the comtypes approach truly the best?
>
>
> Photoshop: no idea. But GIMP might be an alternative:
> http://www.gimp.org/docs/python/. Or PIL + psd tools:
> https://pypi.python.org/pypi/psd-tools
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130820/9ee0afd7/attachment.html>


More information about the Tutor mailing list