You can use win32com to access Photoshop using Python. Possible pseudo code for your work:
- Download the PSD file
- Collect all the layers and make all the layers VISIBLE = OFF
- Rotate one layer after another, mark them VISIBLE = ON and export to PNG
import win32com.client
pApp = win32com.client.Dispatch ('Photoshop.Application')
def makeAllLayerInvisible (lyrs):
for ly in lyrs:
ly.Visible = False
def makeEachLayerVisibleAndExportToPNG (lyrs):
for ly in lyrs:
ly.Visible = True
options = win32com.client.Dispatch ('Photoshop.PNGSaveOptions')
options.Interlaced = False
tf = 'PNG file name with path'
doc.SaveAs (SaveIn = tf, Options = options)
ly.Visible = False
# pApp.Open (PSD file)
doc = pApp.ActiveDocument
makeAllLayerInvisible (doc.Layers)
makeEachLayerVisibleAndExportToPNG (doc.Layers)
source share