{ "info": { "author": "Thomas Sch\u00fc\u00dfler", "author_email": "vindolin@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console" ], "description": "Slice Android style 9-patch images, resize and interactively preview them.\r\n--------------------------------------------------------------------------\r\n\r\n.. image:: https://travis-ci.org/vindolin/ninepatch.svg?branch=master\r\n :width: 90\r\n :alt: Travis CI\r\n :target: https://travis-ci.org/vindolin/ninepatch\r\n\r\nSee https://developer.android.com/tools/help/draw9patch.html for a 9-patch description.\r\n\r\n.. image:: https://raw.githubusercontent.com/vindolin/ninepatch/master/ninepatch/data/ninepatch_bubble.9.png\r\n :width: 320\r\n :alt: Example image\r\n :target: https://raw.githubusercontent.com/vindolin/ninepatch/master/ninepatch/data/ninepatch_bubble.9.png\r\n\r\nInstallation\r\n------------\r\n\r\nIf you want to use the interactive viewer read the additional installation notes under \"Interactive viewer\".\r\n\r\n::\r\n\r\n $ pip install ninepatch\r\n\r\nPython usage\r\n------------\r\n.. code-block:: python\r\n\r\n\r\n from ninepatch import Ninepatch\r\n ninepatch = Ninepatch('ninepatch_bubble.9.png')\r\n print(ninepatch.content_area) # content_area(left=23, top=20, right=27, bottom=59)\r\n\r\n # render the image to a specific size\r\n scaled_image = ninepatch.render(500, 400) # creates a new PIL image\r\n\r\n # render the image so it's content area fits (width, height)\r\n image_fit = ninepatch.render_fit(300, 200)\r\n\r\n # render the image so it wraps another PIL image\r\n image_to_wrap = Image.open('image_to_wrap.png')\r\n wrapped_image = ninepatch.render_wrap(image_to_wrap)\r\n\r\n\r\nCommand line usage\r\n------------------\r\nYour image must be a PNG image with a transparent background.\r\nThe scale and fill guide color must be 100% opaque black.\r\n\r\nScale and open image in a viewer (PIL image.show()):\r\n\r\n::\r\n\r\n $ ninepatch render ninepatch_bubble.9.png 300 300\r\n\r\nSave the scaled image to a new file:\r\n\r\n::\r\n\r\n $ ninepatch render ninepatch_bubble.9.png 300 300 scaled.png\r\n\r\n.. image:: https://raw.githubusercontent.com/vindolin/ninepatch/master/ninepatch/data/ninepatch_bubble_300x300.png\r\n\r\n\r\nRender an image so it's content area fits a given width and height\r\n\r\n::\r\n\r\n $ ninepatch fit ninepatch_bubble.9.png 150 150 fit.png\r\n\r\n.. image:: https://raw.githubusercontent.com/vindolin/ninepatch/master/ninepatch/data/fit.png\r\n\r\nRender an image to include another image\r\n\r\n::\r\n\r\n $ ninepatch wrap ninepatch_bubble.9.png image_to_wrap.png wrapped.png\r\n\r\n.. image:: https://raw.githubusercontent.com/vindolin/ninepatch/master/ninepatch/data/wrapped.png\r\n\r\nSlice the 9patch into tiles:\r\n\r\n::\r\n\r\n $ ninepatch slice ninepatch_bubble.9.png ./outputdir\r\n\r\n.. image:: https://raw.githubusercontent.com/vindolin/ninepatch/master/ninepatch/data/slice_export.png\r\n\r\nInteractive viewer\r\n------------------\r\n\r\n\r\n.. image:: https://raw.githubusercontent.com/vindolin/ninepatch/master/ninepatch/data/ninepatch_viewer_screenshot.png\r\n :width: 419\r\n :alt: ninepatch viewer screenshot\r\n :target: https://raw.githubusercontent.com/vindolin/ninepatch/master/ninepatch/data/ninepatch_viewer_screenshot.png\r\n\r\n\r\nInteractively resize and preview an image in a Tkinter viewer:\r\n\r\n::\r\n\r\n $ ninepatch_viewer ninepatch_bubble.9.png\r\n\r\n or just:\r\n\r\n $ ninepatch_viewer\r\n\r\n without arguments to see the demo image\r\n\r\n\r\nIf you want to use the viewer then python-pil.imagetk has to be installed.\r\n\r\nOn Ubuntu do:\r\n\r\n::\r\n\r\n $ sudo apt-get install python-pil.imagetk\r\n\r\n\r\nIf you want to install into a virtualenv, pip needs the following packages to compile PIL with Tkinter support:\r\n\r\n::\r\n\r\n $ sudo apt-get install python-tk tk8.6-dev\r\n\r\n(You can trigger a recompile of PIL with: \"pip install -I ninepatch\")\r\n\r\n\r\nChangelog\r\n---------\r\n0.1.20\r\n * new commands `fit` and `wrap` courtesy of Nicolas Laurance\r\n0.1.19\r\n * fixed error in caching\r\n0.1.18\r\n * optional caching for slice() and render()\r\n0.1.17\r\n * new method export_slices()\r\n * changed command line parameters (render/slice)\r\n\r\n...", "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/vindolin/ninepatch", "keywords": "android pillow 9-patch ninepatch", "license": "The MIT License (MIT)\r\n\r\nCopyright (c) 2014 Thomas Sch\u00fc\u00dfler\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.", "maintainer": "", "maintainer_email": "", "name": "ninepatch", "package_url": "https://pypi.org/project/ninepatch/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ninepatch/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/vindolin/ninepatch" }, "release_url": "https://pypi.org/project/ninepatch/0.1.20/", "requires_dist": null, "requires_python": null, "summary": "Slice and scale 9-patch images", "version": "0.1.20" }, "last_serial": 1612777, "releases": { "0.1.10": [ { "comment_text": "", "digests": { "md5": "fcf878703436679d95398d30e56d8d36", "sha256": "37269cedda59950ee0656f186b6234886c2328822c657de37b9a4be9a4d03b99" }, "downloads": -1, "filename": "ninepatch-0.1.10.tar.gz", "has_sig": false, "md5_digest": "fcf878703436679d95398d30e56d8d36", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11224, "upload_time": "2014-05-11T09:31:39", "url": "https://files.pythonhosted.org/packages/77/e8/74ba0a7213242ec4f3e547df70094f87f434664d00bde01b9808ba065a66/ninepatch-0.1.10.tar.gz" } ], "0.1.11": [ { "comment_text": "", "digests": { "md5": "ce5129966fb8c5beb13b370aa89aba7c", "sha256": "b1561f93af994185008ecde6646fd078063c98ccb32c9ba4ae08be4defdd6ff5" }, "downloads": -1, "filename": "ninepatch-0.1.11.tar.gz", "has_sig": false, "md5_digest": "ce5129966fb8c5beb13b370aa89aba7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12190, "upload_time": "2014-09-06T16:15:20", "url": "https://files.pythonhosted.org/packages/94/a0/eb1f00276723261fa9d25b0e7048fd9c0a1b9303f2923cb419db94e82303/ninepatch-0.1.11.tar.gz" } ], "0.1.12": [ { "comment_text": "", "digests": { "md5": "3e55d180a52d0db0e63b201e8d61942a", "sha256": "92144647c9750a75b5e04a728a725d312881702486af9c805802fa8f2571a3a5" }, "downloads": -1, "filename": "ninepatch-0.1.12.tar.gz", "has_sig": false, "md5_digest": "3e55d180a52d0db0e63b201e8d61942a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6459, "upload_time": "2014-09-06T19:16:52", "url": "https://files.pythonhosted.org/packages/e7/0b/e879d951b797c64cb5c5f4d46bc5570336543b0d3c47cd196d1cc58643a6/ninepatch-0.1.12.tar.gz" } ], "0.1.13": [ { "comment_text": "", "digests": { "md5": "0e4152bcced63da2051e8bfc4851cf40", "sha256": "31e32141668d6697362f25bd57a74782976412d2c82f9f31d1cc8608893fec4b" }, "downloads": -1, "filename": "ninepatch-0.1.13.tar.gz", "has_sig": false, "md5_digest": "0e4152bcced63da2051e8bfc4851cf40", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12277, "upload_time": "2014-09-06T19:19:51", "url": "https://files.pythonhosted.org/packages/1f/d9/2c25294ce714b4613874a94bb40f8afc22b33836649f17075ca4ab315206/ninepatch-0.1.13.tar.gz" } ], "0.1.14": [ { "comment_text": "", "digests": { "md5": "9878220fc32f33e5eb2fa8f2ffe70cb4", "sha256": "76573da64dd291afe921577257c1a639a85798d2c0ef839992ec273551beea87" }, "downloads": -1, "filename": "ninepatch-0.1.14.tar.gz", "has_sig": false, "md5_digest": "9878220fc32f33e5eb2fa8f2ffe70cb4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12360, "upload_time": "2014-09-07T10:10:29", "url": "https://files.pythonhosted.org/packages/4d/17/7744a274c5ae70a789e25d02e42564785b547bc4117c8dfa9f3805b6498f/ninepatch-0.1.14.tar.gz" } ], "0.1.15": [ { "comment_text": "", "digests": { "md5": "e8f20d1072f35d4b3f0bd8781f808388", "sha256": "1e32b84eec7ffd22bf84857fcfb7fa6ce5b71300dfe0bd714a5d5b887071d4ea" }, "downloads": -1, "filename": "ninepatch-0.1.15.tar.gz", "has_sig": false, "md5_digest": "e8f20d1072f35d4b3f0bd8781f808388", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12382, "upload_time": "2014-09-07T11:52:52", "url": "https://files.pythonhosted.org/packages/64/50/9286f539326218954a854f3bef59e84e628b17a7ba1539da609f20f6b709/ninepatch-0.1.15.tar.gz" } ], "0.1.16": [ { "comment_text": "", "digests": { "md5": "7b989120bd424b256472b3461113a2d2", "sha256": "76ecc8f3a53236e20e27a8cc293bb16868fc1432e098fd4798c0eca784e64674" }, "downloads": -1, "filename": "ninepatch-0.1.16.tar.gz", "has_sig": false, "md5_digest": "7b989120bd424b256472b3461113a2d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12455, "upload_time": "2014-09-07T12:02:27", "url": "https://files.pythonhosted.org/packages/19/4c/856bf02879632df303ba617324b2f0cef7de2440b3e660f40cfdfda3293c/ninepatch-0.1.16.tar.gz" } ], "0.1.17": [ { "comment_text": "", "digests": { "md5": "e5bc79d185a254ef1cc832148133bffb", "sha256": "a823af16ec8a819145fecc802d1e8df8a9aac48f4365648fda13309130bfcb51" }, "downloads": -1, "filename": "ninepatch-0.1.17.tar.gz", "has_sig": false, "md5_digest": "e5bc79d185a254ef1cc832148133bffb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12456, "upload_time": "2014-09-07T12:52:09", "url": "https://files.pythonhosted.org/packages/e5/c0/766b3b1f0221b386ad9bdba2044589998d5b9c9bf44a6274bedd3b29768e/ninepatch-0.1.17.tar.gz" } ], "0.1.18": [ { "comment_text": "", "digests": { "md5": "408c306bf0dab5d56f5fa0e9ab77d6fd", "sha256": "3135d1d4a8854bb7494920fb22f20034411fb4a6239674d4453b610be0f02584" }, "downloads": -1, "filename": "ninepatch-0.1.18.tar.gz", "has_sig": false, "md5_digest": "408c306bf0dab5d56f5fa0e9ab77d6fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12694, "upload_time": "2014-09-07T20:51:06", "url": "https://files.pythonhosted.org/packages/f6/05/def18fe88105127b56ab5a75414a566cacef7b5396f18cabe05bc056daa4/ninepatch-0.1.18.tar.gz" } ], "0.1.19": [ { "comment_text": "", "digests": { "md5": "dcee5b0dee906af083a1f8effe9d0d60", "sha256": "28a86b7ecb449adbfb130b036d1f13a2af011bc398000fa8780695b9b9ee6d00" }, "downloads": -1, "filename": "ninepatch-0.1.19.tar.gz", "has_sig": false, "md5_digest": "dcee5b0dee906af083a1f8effe9d0d60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12844, "upload_time": "2014-09-07T21:15:19", "url": "https://files.pythonhosted.org/packages/65/04/ecfb08e8bc27edb4ecd3d98d81a8fccf4377a637e104a79d29fa244e2b83/ninepatch-0.1.19.tar.gz" } ], "0.1.20": [ { "comment_text": "", "digests": { "md5": "3b114003dbe0b595b7adaec26df08618", "sha256": "b2136454398c35a6a9c24aa883cd365da995a65c32dbe5a2b67aaeac8342ff62" }, "downloads": -1, "filename": "ninepatch-0.1.20.tar.gz", "has_sig": false, "md5_digest": "3b114003dbe0b595b7adaec26df08618", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13999, "upload_time": "2015-06-30T07:48:22", "url": "https://files.pythonhosted.org/packages/b4/6f/6723d3918b9fa8f97e653291000f7860e047609f4fceb2ead8693c1719bf/ninepatch-0.1.20.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3b114003dbe0b595b7adaec26df08618", "sha256": "b2136454398c35a6a9c24aa883cd365da995a65c32dbe5a2b67aaeac8342ff62" }, "downloads": -1, "filename": "ninepatch-0.1.20.tar.gz", "has_sig": false, "md5_digest": "3b114003dbe0b595b7adaec26df08618", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13999, "upload_time": "2015-06-30T07:48:22", "url": "https://files.pythonhosted.org/packages/b4/6f/6723d3918b9fa8f97e653291000f7860e047609f4fceb2ead8693c1719bf/ninepatch-0.1.20.tar.gz" } ] }