{ "info": { "author": "Andreas Bresser, Execution Unit Ltd.", "author_email": "self@andreasbresser.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta" ], "description": "==========\ntxtrpacker\n==========\n\nTexture Packer (based on http://www.executionunit.com/blog/2013/04/12/python-script-to-build-a-texture-page-or-sprite-sheet/ by Execution Unit Ltd.)\n\n.. image:: https://coveralls.io/repos/github/brean/txtrpacker/badge.svg?branch=master\n\nWhy pack textures/images?\n=========================\nIf you're making a game then it's more efficient to tell the hardware:\n\n\n::\n\n use packed texture 1\n draw primitive 1,2,3,4,5,6\n use packed texture 2\n draw primitive 7,8,9,10\n\nthan to\n\n::\n\n use texture 1\n draw primitive 1\n use texture 2\n draw primitive 2\n ...\n\nThe less you do, the more efficient rendering is.\n\nIf you're making a website then again it's quicker to ask the client browser to load one large image (often called a sprite sheet) than to ask it to load many more smaller textures.\n\nAlgorithm\n=========\nThe algorithm we are going to use in called Bin Packing. We want to pack the textures in to one larger texture with the minimum of wasted space. Note that there will always be some wasted space, this is an NP complete problem and Bin Packing just gives you a very good solution not a perfect one\n\n2D bin packing works by using the source images to subdivide the destination image creating a tree of 'used' areas of the destination image. This sounds a little complication but it's actually pretty simple.\n\n\nUsage\n=======\nThe python code can be run from the command line to pack a set of PNGs that are in a directory:\n\n.. code-block:: \n\n usage: txtrpacker.py [-h] [-v] [-pad PAD] [-sort SORT] [-maxdim MAXDIM]\n [--log LOG]\n src dst\n\n A utility to take a set of png images and pack them in to a power of two image\n with pading. The placements of the source images is printed to stdout in the\n format: \"filename x y x2 y2\"\n\n positional arguments:\n src src directory\n dst dest png file\n\n optional arguments:\n -h, --help show this help message and exit\n -v enable verbose mode\n -pad PAD padding on each side of the texture (default: 2)\n -sort SORT sort algorithm one of maxheight,maxwidth,maxarea (default:\n maxarea)\n -maxdim MAXDIM maximum texture size permissable.\n --log LOG Logging level (INFO, DEBUG, WARN) (default: INFO)\n\nusing the example data you could enter:\n\n..\n\n ./txtrpacker.py -pad 4 ./testart output.png\n\n\n\n\nNote\n====\n\nThis project has been set up using PyScaffold 2.2.1. For details and usage\ninformation on PyScaffold see http://pyscaffold.readthedocs.org/.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/brean/txtrpacker", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "txtrpacker", "package_url": "https://pypi.org/project/txtrpacker/", "platform": "", "project_url": "https://pypi.org/project/txtrpacker/", "project_urls": { "Homepage": "https://github.com/brean/txtrpacker" }, "release_url": "https://pypi.org/project/txtrpacker/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "Texture packer", "version": "0.0.2" }, "last_serial": 4519578, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "3f1f221db23238c7d4bbe99829db9fd3", "sha256": "eebf7b1d9eb0634816b0d0d374219902ffdbde9b7f7b550b41dff686baf9e30c" }, "downloads": -1, "filename": "txtrpacker-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "3f1f221db23238c7d4bbe99829db9fd3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7789, "upload_time": "2018-11-23T08:15:29", "url": "https://files.pythonhosted.org/packages/58/83/77add596c92cdf6b84d3a6a6748aafbca9370785fff281cffe2c2dea3bec/txtrpacker-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ada6610b0ceb9204ae44bf42a665cdc8", "sha256": "0d5efccbd7fc459ef1e60e3c7ec0a1750476d9dd70ad7ae2dd2210f45b90e2fa" }, "downloads": -1, "filename": "txtrpacker-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ada6610b0ceb9204ae44bf42a665cdc8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8401, "upload_time": "2018-11-22T21:08:44", "url": "https://files.pythonhosted.org/packages/04/c7/99e385720ebf37411e5ebf15b2af9320d88292cec59510a10b46b3c8a8e0/txtrpacker-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ff0ad5c5176610177cc6a4e76362294a", "sha256": "3a3abeb89fddb46488a44c6cb30cf71e86ae344ef1696adc1c839ba99aac4b7f" }, "downloads": -1, "filename": "txtrpacker-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ff0ad5c5176610177cc6a4e76362294a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6124, "upload_time": "2018-11-22T21:08:46", "url": "https://files.pythonhosted.org/packages/bd/3b/170007e7580d3b0895e5cb22a32dfe163c3d3e0a52d647f1b8988624711a/txtrpacker-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3f1f221db23238c7d4bbe99829db9fd3", "sha256": "eebf7b1d9eb0634816b0d0d374219902ffdbde9b7f7b550b41dff686baf9e30c" }, "downloads": -1, "filename": "txtrpacker-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "3f1f221db23238c7d4bbe99829db9fd3", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 7789, "upload_time": "2018-11-23T08:15:29", "url": "https://files.pythonhosted.org/packages/58/83/77add596c92cdf6b84d3a6a6748aafbca9370785fff281cffe2c2dea3bec/txtrpacker-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ada6610b0ceb9204ae44bf42a665cdc8", "sha256": "0d5efccbd7fc459ef1e60e3c7ec0a1750476d9dd70ad7ae2dd2210f45b90e2fa" }, "downloads": -1, "filename": "txtrpacker-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ada6610b0ceb9204ae44bf42a665cdc8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8401, "upload_time": "2018-11-22T21:08:44", "url": "https://files.pythonhosted.org/packages/04/c7/99e385720ebf37411e5ebf15b2af9320d88292cec59510a10b46b3c8a8e0/txtrpacker-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ff0ad5c5176610177cc6a4e76362294a", "sha256": "3a3abeb89fddb46488a44c6cb30cf71e86ae344ef1696adc1c839ba99aac4b7f" }, "downloads": -1, "filename": "txtrpacker-0.0.2.tar.gz", "has_sig": false, "md5_digest": "ff0ad5c5176610177cc6a4e76362294a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6124, "upload_time": "2018-11-22T21:08:46", "url": "https://files.pythonhosted.org/packages/bd/3b/170007e7580d3b0895e5cb22a32dfe163c3d3e0a52d647f1b8988624711a/txtrpacker-0.0.2.tar.gz" } ] }