{ "info": { "author": "Stephen Neal", "author_email": "stephen@stephenneal.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Multimedia :: Graphics", "Topic :: Multimedia :: Graphics :: Graphics Conversion", "Topic :: Multimedia :: Graphics :: Viewers", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "psd-tools2\n==========\n\n``psd-tools2`` is a package for reading Adobe Photoshop PSD files\nas described in specification_ to Python data structures.\n\nThis is a fork of psd-tools_ that adds a couple of enhancements to the\noriginal version.\n\n.. _specification: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm\n\n.. image:: https://img.shields.io/pypi/v/psd-tools2.svg\n :target: https://pypi.python.org/pypi/psd-tools2\n :alt: PyPI Version\n\n.. image:: https://img.shields.io/travis/kyamagu/psd-tools2/master.svg\n :alt: Build Status\n :target: https://travis-ci.org/kyamagu/psd-tools2\n\n.. image:: https://readthedocs.org/projects/psd-tools2/badge/\n :alt: Document Status\n :target: http://psd-tools2.readthedocs.io/en/latest/\n\n.. _psd-tools: https://github.com/psd-tools/psd-tools\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install psd-tools2\n\nPillow_ should be installed if you want work with PSD image and layer data:\nexport images to PNG, process them. PIL_ library should also work.\n\n.. code-block:: bash\n\n pip install Pillow\n\n.. note::\n\n In order to extract images from 32bit PSD files PIL/Pillow must be built\n with LITTLECMS or LITTLECMS2 support.\n\npsd-tools2 also has a rudimentary support for Pymaging_.\n`Pymaging installation instructions`_ are available in pymaging docs.\n\n.. _PIL: http://www.pythonware.com/products/pil/\n.. _Pillow: https://github.com/python-imaging/Pillow\n.. _packbits: http://pypi.python.org/pypi/packbits/\n.. _Pymaging: https://github.com/ojii/pymaging\n.. _Pymaging installation instructions: http://pymaging.readthedocs.org/en/latest/usr/installation.html\n.. _exifread: https://github.com/ianare/exif-py\n\n\nCommand line\n------------\n\nThe current tool supports PNG/JPEG export:\n\n.. code-block:: bash\n\n psd-tools convert [options]\n psd-tools export_layer [options]\n psd-tools debug [options]\n psd-tools -h | --help\n psd-tools --version\n\n\nAPI Usage\n---------\n\nLoad an image::\n\n >>> from psd_tools import PSDImage\n >>> psd = PSDImage.load('my_image.psd')\n\nPrint the layer structure::\n\n >>> psd.print_tree()\n\nRead image header::\n\n >>> psd.header\n PsdHeader(number_of_channels=3, height=200, width=100, depth=8, color_mode=RGB)\n\nAccess its layers::\n\n >>> psd.layers\n [,\n ,\n ]\n\n >>> list(psd.descendants())\n [,\n ,\n ,\n ...\n ]\n\n\nWork with a layer group::\n\n >>> group2 = psd.layers[0]\n >>> group2.name\n Group 2\n\n >>> group2.visible\n True\n\n >>> group2.opacity\n 255\n\n >>> group2.blend_mode == 'normal'\n True\n\n >>> group2.layers\n []\n\nWork with a layer::\n\n >>> layer = group2.layers[0]\n >>> layer.name\n Shape 2\n\n >>> layer.kind\n type\n\n >>> layer.bbox\n BBox(x1=40, y1=72, x2=83, y2=134)\n\n >>> layer.bbox.width, layer.bbox.height\n (43, 62)\n\n >>> layer.visible, layer.opacity, layer.blend_mode\n (True, 255, 'normal')\n\n >>> layer.text\n 'Text inside a text box'\n\n >>> layer.as_PIL()\n \n\n >>> mask = layer.mask\n >>> mask.bbox\n BBox(x1=40, y1=72, x2=83, y2=134)\n\n >>> mask.as_PIL()\n \n\n >>> layer.clip_layers\n [, ...]\n\n >>> layer.effects\n []\n\nExport a single layer::\n\n >>> layer_image = layer.as_PIL()\n >>> layer_image.save('layer.png')\n\nExport the merged image::\n\n >>> merged_image = psd.as_PIL()\n >>> merged_image.save('my_image.png')\n\nThe same using Pymaging_::\n\n >>> merged_image = psd.as_pymaging()\n >>> merged_image.save_to_path('my_image.png')\n >>> layer_image = layer.as_pymaging()\n >>> layer_image.save_to_path('layer.png')\n\nExport a thumbnail in PIL Image::\n\n >>> thumbnail_image = psd.thumbnail()\n\nExport layer group (experimental)::\n\n >>> group_image = group2.as_PIL()\n >>> group_image.save('group.png')\n\n\nDesign overview\n---------------\n\nThe process of handling a PSD file is split into 3 stages:\n\n1) \"Reading\": the file is read and parsed to low-level data\n structures that closely match the specification. No user-accessible\n images are constructed; image resources blocks and additional layer\n information are extracted but not parsed (they remain just keys\n with a binary data). The goal is to extract all information\n from a PSD file.\n\n2) \"Decoding\": image resource blocks and additional layer\n information blocks are parsed to a more detailed data structures\n (that are still based on a specification). There are a lot of PSD\n data types and the library currently doesn't handle them all, but\n it should be easy to add the parsing code for the missing PSD data\n structures if needed.\n\nAfter (1) and (2) we have an in-memory data structure that closely\nresembles PSD file; it should be fairly complete but very low-level\nand not easy to use. So there is a third stage:\n\n3) \"User-facing API\": PSD image is converted to an user-friendly object\n that supports layer groups, exporting data as ``PIL.Image`` or\n ``pymaging.Image``, etc.\n\nStage separation also means user-facing API may be opinionated:\nif somebody doesn't like it then it should possible to build an\nanother API based on lower-level decoded PSD file.\n\n``psd-tools2`` tries not to throw away information from the original\nPSD file; even if the library can't parse some info, this info\nwill be likely available somewhere as raw bytes (open a bug if this is\nnot the case). This should make it possible to modify and write PSD\nfiles (currently not implemented; contributions are welcome).\n\nFeatures\n--------\n\nSupported:\n\n* reading of RGB, RGBA, CMYK, CMYKA and Grayscale images;\n* 8bit, 16bit and 32bit channels;\n* all PSD compression methods are supported (not only the most\n common RAW and RLE);\n* image ICC profile is taken into account;\n* many image resource types and tagged block types are decoded;\n* layer effects information is decoded;\n* Descriptor structures are decoded;\n* there is an optional Cython extension to make the parsing fast;\n* very basic & experimental layer merging;\n* support both PSD and PSB file formats;\n* EngineData structure is decoded;\n* EXIF data is taken into account.\n\nNot implemented:\n\n* reading of Duotone, LAB, etc. images;\n* some image resource types and tagged blocks are not decoded\n (they are attached to the result as raw bytes);\n* some of the raw Descriptor values are not decoded;\n* this library can't reliably blend layers together: it is possible to export\n a single layer and to export a final image, but rendering of\n e.g. layer group may produce incorrect results;\n* the writing of PSD images is not implemented;\n* Pymaging_ support is limited: it only supports 8bit RGB/RGBA\n images, ICC profiles are not applied, layer merging doesn't work, etc.\n\nIf you need some of unimplemented features then please file an issue\nor implement it yourself (pull requests are welcome in this case).\n\n\nContributing\n------------\n\nDevelopment happens at github: `source code `__,\n`bug tracker `__.\nFeel free to submit ideas, bugs or pull requests.\n\nIn case of bugs it would be helpful to provide a small PSD file\ndemonstrating the issue; this file may be added to a test suite.\n\nIn order to run tests, make sure PIL/Pillow is built with LittleCMS\nor LittleCMS2 support, install `tox `_ and type:\n\n.. code-block:: bash\n\n tox\n\nInstall Sphinx to generate documents:\n\n.. code-block:: bash\n\n pip install sphinx sphinx_rtd_theme\n\nOnce installed, use ``Makefile``:\n\n.. code-block:: bash\n\n make -C docs html\n\nfrom the source checkout.\n\nThe license is MIT.\n\nAcknowledgments\n---------------\n\nGreat thanks to the original `psd-tools` author Mikhail Korobov.\nA full list of contributors can be found here:\nhttps://github.com/kyamagu/psd-tools2/blob/master/AUTHORS.txt\n\n\n1.7.18 (2018-09-26)\n-------------------\n\n- add shape rendering in `compose()`;\n- add grayscale support.\n\n1.7.17 (2018-09-21)\n-------------------\n\n- fix `has_pixel()` condition.\n\n1.7.16 (2018-08-29)\n-------------------\n\n- fix fill opacity in `compose()`;\n- workaround for broken `PrintFlags`.\n\n1.7.15 (2018-08-28)\n-------------------\n\n- fix color overlay issue in `compose()`.\n\n1.7.14 (2018-08-24)\n-------------------\n\n- fix `verbose` arg for python 3.7 compatibility.\n\n1.7.13 (2018-08-10)\n-------------------\n\n- fix `has_pixel()` for partial channels;\n- support color overlay in `compose()`.\n\n1.7.12 (2018-06-25)\n-------------------\n\n- fix mask rendering in compose (Thanks @andrey-hider and @nkato).\n\n1.7.11 (2018-06-11)\n-------------------\n\n- unicode bugfixes.\n\n1.7.10 (2018-06-06)\n-------------------\n\n- fix descriptor decoding errors;\n- minor bugfixes.\n\n1.7.9 (2018-06-05)\n------------------\n\n- fix UnicodeError in exif;\n- workaround for irregular descriptor name;\n- add undocumented `extn` tagged block decoding;\n- move duplicated icc module to subpackage;\n- support PIL rendering with extra alpha channels.\n\n1.7.8 (2018-05-29)\n------------------\n\n- update documentation;\n- fix PEP8 compliance;\n- rename merge_layers to compose.\n\n1.7.7 (2018-05-02)\n------------------\n\n- fix white background issue in `as_PIL()`.\n\n1.7.6 (2018-04-27)\n------------------\n\n- add quality testing;\n- fix disabled mask.\n\n1.7.5 (2018-04-25)\n------------------\n\n- fix `has_mask()` condition;\n- add mask composition in `merge_layers()`;\n- fix mask display.\n\n1.7.4 (2018-03-06)\n------------------\n\n- fix infinity loop in `print_tree()`.\n\n1.7.3 (2018-02-27)\n------------------\n\n- add vector origination API;\n- fix shape and vector mask identification;\n- change enum name conversion;\n- update docs.\n\n1.7.2 (2018-02-14)\n------------------\n\n- add adjustments API;\n- add mask API;\n- bugfix for tagged_blocks decoders.\n\n1.7.1 (2018-02-08)\n------------------\n\n- add mask user API;\n- add layer coordinate user API;\n- add vector mask and vector stroke API;\n- cleanup user API;\n- add automatic descriptor conversion.\n\n\n1.7.0 (2018-01-25)\n------------------\n\n- cleanup user API organization;\n- remove json encoder api;\n- make cli a package main.\n\n1.6.7 (2018-01-17)\n------------------\n\n- workaround for anaconda 2.7 pillow;\n- bbox existence checkf.\n\n1.6.6 (2018-01-10)\n------------------\n\n- experimental clipping support in `merge_layer()`;\n- revert `as_PIL()` in `AdjustmentLayer`.\n\n1.6.5 (2017-12-22)\n------------------\n\n- Small fix for erroneous unicode path name\n\n1.6.4 (2017-12-20)\n------------------\n\n- Add `all_layers()` method;\n- Add `_image_resource_blocks` property;\n- Add `thumbnail()` method.\n\n1.6.3 (2017-09-27)\n------------------\n\n- documentation updates;\n- github repository renamed to psd-tools2;\n- AdjustmentLayer fix.\n\n1.6.2 (2017-09-13)\n------------------\n\n- layer class structure reorganization;\n- add Effects API;\n- add TypeLayer API methods.\n\n1.6 (2017-09-08)\n----------------\n\n- PSDImage user API update;\n- user API adds distinct layer types;\n- Sphinx documentation.\n\n1.5 (2017-07-13)\n----------------\n\n- implemented many decodings of image resources and tagged blocks;\n- implemented EngineData text information;\n- user API for getting mask and patterns;\n- user API to calculate bbox for shape layers;\n\n1.4 (2017-01-02)\n----------------\n\n- Fixed reading of layer mask data (thanks Evgeny Kopylov);\n- Python 2.6 support is dropped;\n- Python 3.6 support is added (thanks Leendert Brouwer);\n- extension is rebuilt with Cython 0.25.2.\n\n1.3 (2016-01-25)\n----------------\n\n- fixed references decoding (thanks Josh Drake);\n- fixed PIL support for CMYK files (thanks Michael Wu);\n- optional C extension is rebuilt with Cython 0.23.4;\n- Python 3.2 support is dropped; the package still works in Python 3.2,\n but the compatibility is no longer checked by tests, and so it can break\n in future.\n- declare Python 3.5 as supported.\n\n1.2 (2015-01-27)\n----------------\n\n- implemented extraction of embedded files (embedded smart objects) -\n thanks Volker Braun;\n- optional C extension is rebuilt with Cython 0.21.2.\n- hg mirror on bitbucket is dropped, sorry!\n\n1.1 (2014-11-17)\n----------------\n\n- improved METADATA_SETTING decoding (thanks Evgeny Kopylov);\n- layer comps decoding (thanks Evgeny Kopylov);\n- improved smart objects decoding (thanks Joey Gentry);\n- user API for getting layer transforms and placed layer size\n (thanks Joey Gentry);\n- IPython import is deferred to speedup ``psd-tools.py`` command-line utility;\n- ``_RootGroup.__repr__`` is fixed;\n- warning message building is more robust;\n- optional C extension is rebuilt with Cython 0.21.1.\n\n1.0 (2014-07-24)\n----------------\n\n- Fixed reading of images with layer masks (thanks Evgeny Kopylov);\n- improved mask data decoding (thanks Evgeny Kopylov);\n- fixed syncronization in case of ``8B64`` signatures (thanks Evgeny Kopylov);\n- fixed reading of layers with zero length (thanks Evgeny Kopylov);\n- fixed Descriptor parsing (thanks Evgeny Kopylov);\n- some of the descriptor structures and tagged block constants are renamed (thanks Evgeny Kopylov);\n- PATH_SELECTION_STATE decoding (thanks Evgeny Kopylov);\n- the library is switched to setuptools; docopt is now installed automatically.\n\n0.10 (2014-06-15)\n-----------------\n\n- Layer effects parsing (thanks Evgeny Kopylov);\n- trailing null bytes are stripped from descriptor strings\n (thanks Evgeny Kopylov);\n- \"Reference\" and \"List\" descriptor parsing is fixed\n (thanks Evgeny Kopylov);\n- scalar descriptor values (doubles, floats, booleans) are now returned\n as scalars, not as lists of size 1 (thanks Evgeny Kopylov);\n- fixed reading of EngineData past declared length\n (thanks Carlton P. Taylor);\n- \"background color\" Image Resource parsing (thanks Evgeny Kopylov);\n- `psd_tools.decoder.actions.Enum.enum` field is renamed to\n `psd_tools.decoder.actions.Enum.value` (thanks Evgeny Kopylov);\n- code simplification - constants are now bytestrings as they should be\n (thanks Evgeny Kopylov);\n- Python 3.4 is supported.\n\n0.9.1 (2014-03-26)\n------------------\n\n- Improved merging of transparent layers (thanks Vladimir Timofeev);\n- fixed layer merging and bounding box calculations for empty layers\n (thanks Vladimir Timofeev);\n- C extension is rebuilt with Cython 0.20.1.\n\n0.9 (2013-12-03)\n----------------\n\n- `psd-tools.py` command-line interface is changed, 'debug' command is added;\n- pretty-printing of internal structures;\n- pymaging support is fixed;\n- allow 'MeSa' to be a signature for image resource blocks\n (thanks Alexey Buzanov);\n- `psd_tools.debug.debug_view` utility function is fixed;\n- Photoshop CC constants are added;\n- Photoshop CC vector origination data is decoded;\n- binary data is preserved if descriptor parsing fails;\n- more verbose logging for PSD reader;\n- channel data reader became more robust - now it doesn't read past\n declared channel length;\n- `psd-tools.py --version` command is fixed;\n- `lsdk` tagged blocks parsing: this fixes some issues with layer grouping\n (thanks Ivan Maradzhyiski for the bug report and the patch);\n- CMYK images support is added (thanks Alexey Buzanov, Guillermo Rauch and\n https://github.com/a-e-m for the help);\n- Grayscale images support is added (thanks https://github.com/a-e-m);\n- LittleCMS is now optional (but it is still required to get proper colors).\n\n0.8.4 (2013-06-12)\n------------------\n\n- Point and Millimeter types are added to UnitFloatType (thanks Doug Ellwanger).\n\n0.8.3 (2013-06-01)\n------------------\n\n- Some issues with descriptor parsing are fixed (thanks Luke Petre).\n\n0.8.2 (2013-04-12)\n------------------\n\n- Python 2.x: reading data from file-like objects is fixed\n (thanks Pavel Zinovkin).\n\n0.8.1 (2013-03-02)\n------------------\n\n- Fixed parsing of layer groups without explicit OPEN_FOLDER mark;\n- Cython extension is rebuilt with Cython 0.18.\n\n0.8 (2013-02-26)\n----------------\n\n- Descriptor parsing (thanks Oliver Zheng);\n- text (as string) is extracted from text layers (thanks Oliver Zheng);\n- improved support for optional building of Cython extension.\n\n0.7.1 (2012-12-27)\n------------------\n\n- Typo is fixed: ``LayerRecord.cilpping`` should be ``LayerRecord.clipping``.\n Thanks Oliver Zheng.\n\n0.7 (2012-11-08)\n----------------\n\n- Highly experimental: basic layer merging is implemented\n (e.g. it is now possible to export layer group to a PIL image);\n- ``Layer.visible`` no longer takes group visibility in account;\n- ``Layer.visible_global`` is the old ``Layer.visible``;\n- ``psd_tools.user_api.combined_bbox`` made public;\n- ``Layer.width`` and ``Layer.height`` are removed (use ``layer.bbox.width``\n and ``layer.bbox.height`` instead);\n- ``pil_support.composite_image_to_PIL`` is renamed to ``pil_support.extract_composite_image`` and\n ``pil_support.layer_to_PIL`` is renamed to ``pil_support.extract_layer_image``\n in order to have the same API for ``pil_support`` and ``pymaging_support``.\n\n0.6 (2012-11-06)\n----------------\n\n- ``psd.composite_image()`` is renamed to ``psd.as_PIL()``;\n- Pymaging support: ``psd.as_pymaging()`` and ``layer.as_pymaging()`` methods.\n\n\n0.5 (2012-11-05)\n----------------\n\n- Support for zip and zip-with-prediction compression methods is added;\n- support for 16/32bit layers is added;\n- optional Cython extension for faster zip-with-prediction decompression;\n- other speed improvements.\n\n0.2 (2012-11-04)\n----------------\n\n- Initial support for 16bit and 32bit PSD files: ``psd-tools`` v0.2 can\n read composite (merged) images for such files and extract information\n (names, dimensions, hierarchy, etc.) about layers and groups of 16/32bit PSD;\n extracting image data for distinct layers in 16/32bit PSD files is not\n suported yet;\n- better ``Layer.__repr__``;\n- ``bbox`` property for ``Group``.\n\n0.1.4 (2012-11-01)\n------------------\n\nPackaging is fixed in this release.\n\n0.1.3 (2012-11-01)\n------------------\n\n- Better support for 32bit images (still incomplete);\n- reader is able to handle \"global\" tagged layer info blocks that\n was previously discarded.\n\n0.1.2 (2012-10-30)\n------------------\n\n- warn about 32bit images;\n- transparency support for composite images.\n\n0.1.1 (2012-10-29)\n------------------\n\nInitial release (v0.1 had packaging issues).", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mrstephenneal/psd-tools3", "keywords": "pymaging psd imaging pil pillow", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "psd-tools3", "package_url": "https://pypi.org/project/psd-tools3/", "platform": "", "project_url": "https://pypi.org/project/psd-tools3/", "project_urls": { "Homepage": "https://github.com/mrstephenneal/psd-tools3" }, "release_url": "https://pypi.org/project/psd-tools3/1.8.2/", "requires_dist": null, "requires_python": "", "summary": "Fork of psd-tools for working with Adobe Photoshop PSD files", "version": "1.8.2" }, "last_serial": 4328945, "releases": { "1.8.0": [ { "comment_text": "", "digests": { "md5": "3a9da6e68b4b149e6cfcdec08d19b03d", "sha256": "d029386151a03bd65bd255a00f0b4c041ca020a2238626413374bd37482c651c" }, "downloads": -1, "filename": "psd-tools3-1.8.0.tar.gz", "has_sig": false, "md5_digest": "3a9da6e68b4b149e6cfcdec08d19b03d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 167127, "upload_time": "2018-10-01T14:37:39", "url": "https://files.pythonhosted.org/packages/8f/a9/ce67289f7a1e8d8ccc282cb227a73437720ca00a808a510c5ba3010eec27/psd-tools3-1.8.0.tar.gz" } ], "1.8.1": [ { "comment_text": "", "digests": { "md5": "770f8917fbf2cd25245215c475bae38f", "sha256": "1174484df1ac669370054fb8a0aecf8305dba901f8073fc944eb6f1ddb3963ed" }, "downloads": -1, "filename": "psd-tools3-1.8.1.tar.gz", "has_sig": false, "md5_digest": "770f8917fbf2cd25245215c475bae38f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 167419, "upload_time": "2018-10-01T14:39:12", "url": "https://files.pythonhosted.org/packages/54/4b/1aed326c72710b453cb817da2bd68754b7f15ae6f2c6febdd61b0793aa3e/psd-tools3-1.8.1.tar.gz" } ], "1.8.2": [ { "comment_text": "", "digests": { "md5": "9d0ab4455020fdea080bf354ddfaec7b", "sha256": "3a03bb8c7757e477b5ab1a7a35e8d5064493655f08682779ec7d5ff610954440" }, "downloads": -1, "filename": "psd-tools3-1.8.2.tar.gz", "has_sig": false, "md5_digest": "9d0ab4455020fdea080bf354ddfaec7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 167446, "upload_time": "2018-10-01T15:11:06", "url": "https://files.pythonhosted.org/packages/de/1b/88e605453a5d2b2168140bb520c4aa6361d7cce742b5e6ae8a8a14638959/psd-tools3-1.8.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9d0ab4455020fdea080bf354ddfaec7b", "sha256": "3a03bb8c7757e477b5ab1a7a35e8d5064493655f08682779ec7d5ff610954440" }, "downloads": -1, "filename": "psd-tools3-1.8.2.tar.gz", "has_sig": false, "md5_digest": "9d0ab4455020fdea080bf354ddfaec7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 167446, "upload_time": "2018-10-01T15:11:06", "url": "https://files.pythonhosted.org/packages/de/1b/88e605453a5d2b2168140bb520c4aa6361d7cce742b5e6ae8a8a14638959/psd-tools3-1.8.2.tar.gz" } ] }