Tag Archives: Python PS Background

Python: How to Costomize the Background of PS

Here is the example code on how to modify the PS background.

Nedd to Install  photoshop-python-api
 
 1 """Change the color of the background and foreground."""
 2 # Import local modules
 3 from photoshop import Session
 4 
 5 
 6 with Session() as ps:
 7     foregroundColor = ps.SolidColor()
 8     foregroundColor.rgb.red = 255
 9     foregroundColor.rgb.green = 0
10     foregroundColor.rgb.blue = 0
11     ps.app.foregroundColor = foregroundColor
12 
13     backgroundColor = ps.SolidColor()
14     backgroundColor.rgb.red = 0
15     backgroundColor.rgb.green = 0
16     backgroundColor.rgb.blue = 0
17     ps.app.backgroundColor = backgroundColor