{ "info": { "author": "John Crawford", "author_email": "psp_dev@crawfishpress.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Operating System :: Microsoft", "Operating System :: Microsoft :: Windows", "Operating System :: Microsoft :: Windows :: Windows 7", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 2 :: Only", "Topic :: Multimedia :: Graphics", "Topic :: Multimedia :: Graphics :: Graphics Conversion", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "PSP\\_Scan\n---------\n\nThis is a library for reading Paintshop Pro files (.pspimage), and\nconverting to BMPs or PNGs. Any PNG files saved, will have a\ntransparency-layer mask stored in the Alpha channel. This enables the\nPNG files to be used in websites, or in game-development, etc.\n\nYou can access the blocks comprising a PSP file, either\nprogrammatically, using a Python API, or via command-line arguments, and\nmanipulate or save them to files. They can also be converted to\nPillow.Image objects, which lets you use any Pillow function on them,\nincluding saving in formats other than BMP/PNG.\n\nPaintshop Pro is a full-featured graphics-editing (raster and vector)\nprogram for Windows (only).\n\nPillow is a Python-package for manipulating graphics (which this library\nmakes use of).\n\nSupported\n---------\n\n- Files saved in PSP X format (file-format version 8)\n\n - this is an older version than the latest commercial software sold,\n so you need to use File->Save-As\n - (note this is the last release I can find specification-documents\n for)\n\n- Layers saved in Uncompressed format\n\n - Use File->Save-As, and select ``Uncompressed`` format\n - RLE/LZ77 formats not yet supported, code will raise exception -\n fixing this is high on my TODO list\n\n- Layers of type Raster/Mask/Group\n\n - Adjustment-layers, etc, are silently ignored, no exceptions raised\n\n- Two layers maximum in a group (raster + mask) - adding more is also\n on my TODO list\n- PNG files saved, will have a transparency-layer (Alpha channel)\n grabbed from the PSP file's Alpha channel.\n- CLI (Command-Line Interface), for file manipulation/conversion,\n individually, or by directory\n- API commands for file manipulation/conversion\n- Python 2.7\n- Tested on Windows 7 (Powershell), should work on later versions\n\nPip Requirements\n----------------\n\n- pillow>=3.3.0\n- virtualenv (optional, but highly recommended - also\n virtualenvwrapper)\n\nInstallation for Windows\n------------------------\n\nSee\n`windows-install `__\nfor full instructions on installing the program locally.\n\nNote: if you don't care about virtual environments, installing from PyPi\nis simple:\n\n::\n\n pip install psp_scan\n\nIf it worked, **and** your Python site-packages directory is in either PATH\nor PYTHONPATH, then do:\n\n::\n\n python -m psp_scan -h\n\nIf it *didn't* work, then see\n`windows-install `__\nfor more information about setting paths.\n\nCLI and API\n-----------\n\nThere are two ways you can use the package, either by a command-line\ninterface, or Python API.\n\nThe CLI is simpler - you run the ``psp_scan`` package, and give it\nvarious arguments, such as what file to convert, and to which format,\nand it performs that action. However, the CLI arguments available are\nonly a subset of the API commands.\n\nThe API is more complex - you need to write a Python program that\nimports the ``psp_scan`` package, and write functions that manipulate\nthe Image as wanted, and other functions that save the resulting Image.\nHowever, there are more features in the API, which might not be\navailable in the CLI - so if you wanted them, you'd have to use the API.\nEspecially, Pillow functions are available - for instance, you could\nrotate an image by 90 degrees, or scale it, etc.\n\nCLI Usage\n---------\n\nSee\n`cli-docs `__\nfor details\n\nExample of CLI usage and output\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n`Examples `__\n\nCLI Commands-list\n~~~~~~~~~~~~~~~~~\n\n::\n\n usage: psp_scan.py [-h] [-f {png,bmp}] [-m MASK] [-i DIR] [-o DIR] [-n] [-x] [-l] [-v] [-t] [file_in]\n\n psp_scan some_file.pspimage # converts a single file to .png (default)\n psp_scan some_file.pspimage -m 3 # converts a single file to .png, and uses layer 3 mask in Alpha channel\n psp_scan some_file.pspimage -f bmp # converts a single file to .bmp\n\n psp_scan -i some_dir -v # converts all files (recursively) inside directory, prints output\n psp_scan -i some_dir -o new_dir # converts all files (recursively) to new directory\n\n psp_scan -l some_file.pspimage # lists basic block information for file (add -v for more detail)\n psp_scan -x some_file.pspimage # expands file into blocks/layers, saves to new directory\n\n positional arguments:\n file_in single file to convert (optional)\n\n optional arguments:\n -h, --help show this help message and exit\n -f {png,bmp}, --format {png,bmp} format to convert file into (optional, default=png)\n -m MASK, --mask MASK mask-layer to use for PNG Alpha channel, for single file\n -i DIR, --input-dir DIR directory to read files from (optional)\n -o DIR, --output-dir DIR directory to save converted files (optional)\n -n, --non-recursive read directories non-recursively (default is recursive)\n -x, --expand expand file into layers/blocks, save into directory\n -l, --list list basic block info (no file conversion) - add -v for more detail\n -v, --verbose extra output when processing files\n\nAPI Usage\n---------\n\nSee\n`api-docs `__\nfor details\n\nAPI Properties-list\n~~~~~~~~~~~~~~~~~~~\n\n::\n\n - pic.doc\n - pic.header # returns a dict with selected data fields in PSP.info_chunk\n - pic.header_full # returns a dict with all data fields in PSP.info_chunk\n - pic.filename # returns the file used (as a string), or None if a file-pointer was passed in\n - pic.width # width/height for the entire image\n - pic.height\n - pic.blocks # returns a list of blocks - the most important block, layers, has its own property\n - pic.layers # returns a list of layers\n - pic.as_PIL # returns a Pillow.Image object using the image's full bitmap (all layers combined)\n\n - pic.layers[0].doc\n - pic.layers[0].header # returns a dict with all data fields in PSP.Layer.info_chunk\n - pic.layers[0].name # returns name of layer\n - pic.layers[0].width # width/height of the visible bitmap-rectangle in the Layer - note this\n - pic.layers[0].height # could be smaller than the image's width/height\n - pic.layers[0].rect # returns the rectangle (or bounding-box) that contains all the visible pixels for this layer\n - pic.layers[0].as_PIL # returns a Pillow.Image object using the layer's bitmap and width/height,\n # or None if the layer doesn't have a bitmap (like a Group-layer) - check the return\n - pic.layers[0].as_XL # same as .as_PIL, but expands the layer to full image-size\n\nAPI functions\n~~~~~~~~~~~~~\n\n::\n\n pic.save_layers_to_file(tmp_dir) # Saves Raster/Mask layers to separate bitmap files\n pic.save_blocks_to_file(tmp_dir) # Saves everything in all layers (channels, masks, etc) to bitmap files\n pic.mask_to_alpha(7) # returns a Pillow.Image object with an Alpha channel, from the selected mask\n\nPillow functions\n~~~~~~~~~~~~~~~~\n\nBecause the ``.as_PIL/.as_XL`` property returns a Pillow.Image object,\nyou can use any of the Pillow functions that work on one. For example:\n\n::\n\n >>> foo = pic.layers[2].as_PIL\n >>> foo.save('layer_three.bmp')\n >>> flipped = foo.transpose(Image.ROTATE_90)\n >>> flipped.save('layer_three_rot90.bmp')\n\nThis includes saving in other formats - for instance:\n\n::\n\n >>> foo.save('layer_three.tiff', format='tiff')\n\nAdditional Random Documentation\n-------------------------------\n\n- `Blocks Overview `__\n- `General Code Notes `__\n- `Project Origin `__\n\nSome Credits\n~~~~~~~~~~~~\n\nThanks to\n`LeviFiction `__\nfor helping me with some file-format questions.\n\n\npsp\\_scan changelog\n===================\n\n0.9 (2016-09-01)\n----------------\n\n- initial commit (John Crawford)", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Crawfishpress/psp_scan", "keywords": "paintshoppro psp imaging conversion pil pillow", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "psp-scan", "package_url": "https://pypi.org/project/psp-scan/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/psp-scan/", "project_urls": { "Homepage": "https://github.com/Crawfishpress/psp_scan" }, "release_url": "https://pypi.org/project/psp-scan/0.9/", "requires_dist": [ "Pillow (>=3.3.0)" ], "requires_python": "", "summary": "Python package for working with Paintshop Pro files", "version": "0.9" }, "last_serial": 2327307, "releases": { "0.9": [ { "comment_text": "", "digests": { "md5": "d384f2d0ec94e9447c728d40e23a5baf", "sha256": "2bbec12340b3096a6ecf892abc6abda51550d0bcbce24b3d5382900d5f442c03" }, "downloads": -1, "filename": "psp_scan-0.9-py2-none-any.whl", "has_sig": false, "md5_digest": "d384f2d0ec94e9447c728d40e23a5baf", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 33373, "upload_time": "2016-09-06T13:13:23", "url": "https://files.pythonhosted.org/packages/4c/25/11363185808367656cd39a8d0e7e52b28191283a5df8ef6f8e1c837fc888/psp_scan-0.9-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "376a56998f8f3e50eee4cd8370b5a433", "sha256": "bce9294f98da8bf34fa02105a714c1cdc7e7336e43e22fab8af460a2a27adfc0" }, "downloads": -1, "filename": "psp_scan-0.9.tar.gz", "has_sig": false, "md5_digest": "376a56998f8f3e50eee4cd8370b5a433", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26249, "upload_time": "2016-09-06T13:13:26", "url": "https://files.pythonhosted.org/packages/8a/29/13bfc0ae2e9c751cfd728e59dd04fbfd0da33e32a0daf623d972ef044eb7/psp_scan-0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d384f2d0ec94e9447c728d40e23a5baf", "sha256": "2bbec12340b3096a6ecf892abc6abda51550d0bcbce24b3d5382900d5f442c03" }, "downloads": -1, "filename": "psp_scan-0.9-py2-none-any.whl", "has_sig": false, "md5_digest": "d384f2d0ec94e9447c728d40e23a5baf", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 33373, "upload_time": "2016-09-06T13:13:23", "url": "https://files.pythonhosted.org/packages/4c/25/11363185808367656cd39a8d0e7e52b28191283a5df8ef6f8e1c837fc888/psp_scan-0.9-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "376a56998f8f3e50eee4cd8370b5a433", "sha256": "bce9294f98da8bf34fa02105a714c1cdc7e7336e43e22fab8af460a2a27adfc0" }, "downloads": -1, "filename": "psp_scan-0.9.tar.gz", "has_sig": false, "md5_digest": "376a56998f8f3e50eee4cd8370b5a433", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26249, "upload_time": "2016-09-06T13:13:26", "url": "https://files.pythonhosted.org/packages/8a/29/13bfc0ae2e9c751cfd728e59dd04fbfd0da33e32a0daf623d972ef044eb7/psp_scan-0.9.tar.gz" } ] }