Skip to main content

The API for using COM (Component Object Model) objects interfaces of Photoshop.

Project description

photoshop_python_api

python version PyPI version Documentation Status Downloads Status license pypi format

The API for using COM (Component Object Model) objects interfaces of Photoshop.

https://photoshop-python-api.readthedocs.io

logo

Has been tested and used Photoshop version:

- 2020
- cc2019
- cc2018
- cc2017
- cs6

Installing

You can install via pip.

pip install photoshop_python_api

or through clone from Github.

git clone https://github.com/loonghao/photoshop_python_api.git

Install package.

python setup.py install

Since it uses COM (Component Object Model) connect Photoshop, it can be used in any DCC software with a python interpreter.

Hello World

import photoshop as ps
app = ps.Application()
doc = app.documents.add()
new_doc = doc.artLayers.add()
text_color = ps.SolidColor()
text_color.rgb.green = 255
new_text_layer = new_doc
new_text_layer.kind = ps.LayerKind.TextLayer
new_text_layer.textItem.contents = 'Hello, World!'
new_text_layer.textItem.position = [160, 167]
new_text_layer.textItem.size = 40
new_text_layer.textItem.color = text_color
options = ps.JPEGSaveOptions(quality=5)
# # save to jpg
jpg = 'd:/hello_world.jpg'
doc.saveAs(jpg, options, asCopy=True)
app.doJavaScript(f'alert("save to jpg: {jpg}")')

demo

More examples

Useful links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

photoshop_python_api-0.4.0.tar.gz (8.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

photoshop_python_api-0.4.0-py2.py3-none-any.whl (29.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file photoshop_python_api-0.4.0.tar.gz.

File metadata

  • Download URL: photoshop_python_api-0.4.0.tar.gz
  • Upload date:
  • Size: 8.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

File hashes

Hashes for photoshop_python_api-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4079ad9791655219920e4d3ff60e639d4230961e624e260f0b2af0c1e401a8c3
MD5 e9f052c13e8a6cc24e2482b0f6fd49b5
BLAKE2b-256 8233b01640c354a4453079665bc2a9ea764bc5f2857b1df5b1b6312cdfffdba8

See more details on using hashes here.

File details

Details for the file photoshop_python_api-0.4.0-py2.py3-none-any.whl.

File metadata

  • Download URL: photoshop_python_api-0.4.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4

File hashes

Hashes for photoshop_python_api-0.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 58c8597a220507bfe54ebbd66b8cccfcf10c2ccdb0638b0b1391c8e2cbf8b001
MD5 9b2e1beec5cfce34ddaea51dbc19ec27
BLAKE2b-256 66f9cc5f8a30713dbc75b82643b351a7f5602c06b6b17bef31d80ffe756b9c74

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page