All Projects → lohriialo → Photoshop Scripting Python

lohriialo / Photoshop Scripting Python

Scripting in Photoshop is used to automate a wide variety of repetitive task or as complex as an entire new feature

Programming Languages

python
139335 projects - #7 most used programming language
scripting
82 projects

Projects that are alternatives of or similar to Photoshop Scripting Python

Photoshop-Export-Layers-to-Files-Fast
This script allows you to export your layers as individual files at a speed much faster than the built-in script from Adobe.
Stars: ✭ 1,127 (+301.07%)
Mutual labels:  photoshop, adobe
Creative Cloud Linux
PlayOnLinux install script for Adobe Creative Cloud
Stars: ✭ 725 (+158.01%)
Mutual labels:  photoshop, adobe
alchemist
DevTool for plugin developers
Stars: ✭ 65 (-76.87%)
Mutual labels:  photoshop, adobe
Adobe Scripts Panel
Scripting Panel for After Effects, Illustrator, and Photoshop
Stars: ✭ 211 (-24.91%)
Mutual labels:  photoshop, adobe
brutalism
Battleaxe's component library for Adobe CEP panels
Stars: ✭ 43 (-84.7%)
Mutual labels:  photoshop, adobe
adobe-discord-rpc
Discord Rich Presence extension for your adobe apps!
Stars: ✭ 383 (+36.3%)
Mutual labels:  photoshop, adobe
Icondrop
Get access to 2 million+ design resources right inside Adobe Xd, Figma, Sketch, Microsoft Office, G Suite and many more.
Stars: ✭ 174 (-38.08%)
Mutual labels:  photoshop, adobe
ExtendScript
🍆 Getting started with ExtendScript ✨ by Jeff Davis
Stars: ✭ 23 (-91.81%)
Mutual labels:  photoshop, adobe
ovid-editor
Adobe panel providing the most advanced scripting environment possible -- Typescript, app DOM autocomplete, full I/O features and more
Stars: ✭ 43 (-84.7%)
Mutual labels:  photoshop, adobe
xd-plugin-boilerplate
A boilerplate for plugins for Adobe XD CC including preconfigured linting, autocompletion and Webpack for bundling
Stars: ✭ 25 (-91.1%)
Mutual labels:  adobe
Duik-15
Duduf IK & Animation Tools for Adobe After Effects
Stars: ✭ 156 (-44.48%)
Mutual labels:  adobe
aio-cli
Adobe I/O Extensible CLI
Stars: ✭ 51 (-81.85%)
Mutual labels:  adobe
memory
A script for Adobe After Effects to save precomp layers with live preview
Stars: ✭ 60 (-78.65%)
Mutual labels:  adobe
adobe-scripts
Drafts and unsorted JSX scripts for Adobe Illustrator, Photoshop
Stars: ✭ 29 (-89.68%)
Mutual labels:  adobe
extendscript-starter
Starter project for extendscript-bundler + live reload capabilities
Stars: ✭ 26 (-90.75%)
Mutual labels:  adobe
filterox-repo
filterox - website sederhana manipulasi gambar
Stars: ✭ 15 (-94.66%)
Mutual labels:  photoshop
ai-image-fill
Simple Adobe Illustrator Panel to generate placeholder image content from Flickr or Unsplash
Stars: ✭ 30 (-89.32%)
Mutual labels:  adobe
Lottieuwp
UWP port of Lottie(https://github.com/airbnb/lottie-android)
Stars: ✭ 276 (-1.78%)
Mutual labels:  adobe
Make-This
Project files for the Make This video series and community challenges.
Stars: ✭ 16 (-94.31%)
Mutual labels:  photoshop
ID-MultiPageImporter
Script for automating the placing (import) of PDF and InDesign files inside Adobe InDesign
Stars: ✭ 77 (-72.6%)
Mutual labels:  adobe

Photoshop Scripting in Python

Scripting in Photoshop is used to automate repetitive tasks and are often used as a creative tool to streamline tasks that might be too time consuming to do manually. For example, you could write a script to generate a number of localized versions of a particular image or to gather information about the various color profiles used by a collection of images.

Photoshop COM & DOM

Photoshop can be scripted through COM(Component Object Model). Its DOM(Document Object Model) is the same when accessing it through either its own JavaScript engine or Python or any other scripting language it supports. The Photoshop DOM consists of a hierarchical representation of the Photoshop application, the documents used in it, and the components of the documents. The DOM allows you to programmatically access and manipulate the document and its components. For example, through the DOM, you can create a new document, add a layer to an existing document, or change the background color of a layer. Most of the functionality available through the Photoshop user interface is available through the DOM.

But why Python?

Photoshop scripting officially supports JavaScript, AppleScript & VBScript. However, Scripting in Python is also fairly easy if not easier if you're already comfortable with Python. You may have already heard that Python is gaining in popularity, but did you know it’s now the most popular introductory programming language in U.S. universities? Python is also cross platform just like JavaScript is and lately becoming one of the fastest growing programming language according to StackOverflow as of 2017 / as of 2019

Python is easy to use, powerful, and versatile, making it a great choice for beginners and experts alike. Python’s readability makes it a great first programming language - it allows you to think like a programmer and not waste time understanding the mysterious syntax that other programming languages can require.

Getting Started

Python allows you to access COM and it's DOM with the help of a Python extensions like "pypiwin32" or "comtypes". Install these modules and you're ready to start scripting Photoshop in Python

  • pip install pypiwin32 or pip install comtypes

Hello World!

from win32com.client import Dispatch

app = Dispatch("Photoshop.Application")
doc = app.Documents.Add(320, 240)
layerRef = doc.ArtLayers.Add()

psTextLayer = 2  # from enum PsLayerKind
layerRef.Kind = psTextLayer

textItem = layerRef.TextItem
textItem.Contents = "HELLO WORLD!"
textItem.Position = (120, 120)

How to inspect scripting object properties?

There's not a straight forward way, you need to read the documentation to understand what properties/attributes are available for a scripting object, or possibly a COM browser. For example, I've extracted the Python scripting object reference for Photoshop CC 2018 at api_reference

GUI tool example

See gui_tool for an example of how you can use Photoshop Scripting to develop your own tool/utilities

Scripting on Mac?

Yes, scripting on Mac is also possible, see mac_scripting for more details

Photoshop Scripting Resources

Also see

Contribution

If you've written a useful Photoshop Python script and wants to share with the world, please create a new issue with the file as an attachment to the issue.

When you submit a script, please try to include the following information at the start of your script

# script_file_name.py

# Created: 1st January 2019
__author__ = 'Your Name or Original Author Name'
__version__ = '1.0'

"""
A short description of what the script does
"""

"""
Instructions on how to use the script, if any
"""

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].