Adobe Photoshop automation

The following script adjusts the brightness and contrast of an image via COM automation of Adobe Photoshop with Python and the win32com package.

import win32com.client  
psApp = win32com.client.Dispatch("Photoshop.Application") 
psApp.Open(r"D:\temp\blah.psd")         # Opens a PSD file  
doc = psApp.Application.ActiveDocument  # Get active document object  
layer = doc.ArtLayers[0]                # Get the bottom-most layer  
layer.AdjustBrightnessContrast(20,-15)  # Bright +20, Contrast -15  
doc.Save() 

This comes from http://techarttiki.blogspot.com/2008/08/photoshop-scripting-with-python.html where you can find more excellent examples to automate Adobe Photoshop.

Leave a Reply

Your email address will not be published. Required fields are marked *