{ "info": { "author": "Mo Norman", "author_email": "ltaoist6@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "===========\npysprites\n===========\n\nSometimes, designer will give you a visual production, and that you need to \ncrop the little sprites off from the files, merge them into a png files, and\nwrite a css files for such sprites. \n\nThis tools make everything in onkey.\n\nInstall\n-------\n\n::\n\n $ pip install pysprites\n \n\nExample\n-------\n\n::\n\n $ pysprites -i page1.psd -m icon- -b -r -c page1.css -o page1.png\n\n\nThis command will import layers whose name starts with ``icon-``, from ``page1.psd``, reposition them, \noutput the css for each sprite to ``page1.css``, and output the merged png to ``page1.png``\n\nCommand line\n------------\n\n::\n\n $ pysprites [args...]\n \n -i a.psd b.psd ... : import psd layer from psd files (need psd_tools)\n -a x.png y.png ... : add png files\n -m filter : only handle layer or image name startswith filter\n -p padding : add padding for each sprite\n -r : reposition sprites\n -cp string : use string as css class prefix\n -b : gen sprite width and height for css\n -c out.css : output css to file\n -o out.png : output merged png to file\n\nFramework\n---------\n\nActually, everything is in a single file : ``pysprites/sprites.py``. \n\nIn a task, everything present as a \"General Sprite Process Group\" (gsp), it is struct is as follow::\n\n gsp :: (width, height, img, padding, prefix, args)\n img :: list of [[name, [width, height],[left, top], PIL_object]\n \nAnd the gsp go though handlers, a handler reposition the img, and a handler save it to png, and so on.\n\nReposition Algorithm\n--------------------\n\n1. Select two most height sprites and the final image height.\n2. Find a lowest gap.\n3. Select a longest sprite that can be insert to left, and insert it.\n4. If cannot insert it, fill the gap and goto step2.\n5. Repeat untail every sprite has been inserted.\n\nUsing a EdgeLines struct to maintain the lowest gap, and the ``gsp_reposition`` function implements\nthis algorithm. See the code in ``pysprites/sprites.py``\n\nContribute\n-----------\n\nI think this tools is good enough for me. However, Welcome for new handlers, for example,\nimport the layer from a GIMP ``xcf`` file, or new reposition algorithm, or any participation !\n\nEnjoy it!", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/LTaoist/pysprites", "keywords": "sprite images generator png sprites css psd", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "pysprites", "package_url": "https://pypi.org/project/pysprites/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pysprites/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/LTaoist/pysprites" }, "release_url": "https://pypi.org/project/pysprites/2.0/", "requires_dist": null, "requires_python": null, "summary": "A mirco python tools for sprite image, support Photoshop layer data", "version": "2.0" }, "last_serial": 1196299, "releases": { "2.0": [ { "comment_text": "", "digests": { "md5": "f788d0486c6615e983490419f568b7ef", "sha256": "e932ee0b5928cad2e71138350d389b7c834ab58f811f77f4736e4d5b76245e88" }, "downloads": -1, "filename": "pysprites-2.0-py2.7.egg", "has_sig": false, "md5_digest": "f788d0486c6615e983490419f568b7ef", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 11135, "upload_time": "2014-08-20T08:34:14", "url": "https://files.pythonhosted.org/packages/c7/bb/876cb7833ae4912738bffceb29742ae68f72b4e19bead423c07996ac8358/pysprites-2.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "4db1aadeeea314bfb0475ea02f7fc7c8", "sha256": "54c24f8f47f74dc4784a1cf79e562badeacd7a9051245e048d7e791fba9471e6" }, "downloads": -1, "filename": "pysprites-2.0.tar.gz", "has_sig": false, "md5_digest": "4db1aadeeea314bfb0475ea02f7fc7c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5145, "upload_time": "2014-08-20T08:29:18", "url": "https://files.pythonhosted.org/packages/e2/c6/c94a6dad6a2820510322c7f1faef292096bbe1d1f5d1b491b2341795d927/pysprites-2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f788d0486c6615e983490419f568b7ef", "sha256": "e932ee0b5928cad2e71138350d389b7c834ab58f811f77f4736e4d5b76245e88" }, "downloads": -1, "filename": "pysprites-2.0-py2.7.egg", "has_sig": false, "md5_digest": "f788d0486c6615e983490419f568b7ef", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 11135, "upload_time": "2014-08-20T08:34:14", "url": "https://files.pythonhosted.org/packages/c7/bb/876cb7833ae4912738bffceb29742ae68f72b4e19bead423c07996ac8358/pysprites-2.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "4db1aadeeea314bfb0475ea02f7fc7c8", "sha256": "54c24f8f47f74dc4784a1cf79e562badeacd7a9051245e048d7e791fba9471e6" }, "downloads": -1, "filename": "pysprites-2.0.tar.gz", "has_sig": false, "md5_digest": "4db1aadeeea314bfb0475ea02f7fc7c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5145, "upload_time": "2014-08-20T08:29:18", "url": "https://files.pythonhosted.org/packages/e2/c6/c94a6dad6a2820510322c7f1faef292096bbe1d1f5d1b491b2341795d927/pysprites-2.0.tar.gz" } ] }