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  

This comes from 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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.