{ "info": { "author": "Boris Verkhovskiy", "author_email": "boris@verhovs.ky", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3 :: Only" ], "description": "[`squircle.py`](https://pypi.org/project/squircle/) is a Python utility for\nstretching circles into squares and squishing squares into circles. It requires\nPython 3.6 or later.\n\n### Installation\n\n```sh\npip insall squircle\n```\n\n### Usage:\n\n```python\nfrom squircle import to_circle, to_square\nfrom PIL import Image\n\nsquare = np.asarray(Image.open('some-square-image.jpg'))\ncircle = to_circle(square)\nand_back_to_square = to_square(circle)\n```\n\nthere's 3 stretching methods you can choose from\n\n```python\n>>> from squircle import methods\n>>> list(methods.keys())\n['fgs', 'stretch', 'elliptical']\n>>> circle = to_circle(square, method='elliptical')\n```\n\n#### Stretching methods\n\n##### Fern\u00e1ndez-Guasti squircle (`fgs`)\n\nThe Fern\u00e1ndez-Guasti squircle is used by default.\n\nhttps://squircular.blogspot.com/2015/09/fernandez-guastis-squircle.html\n\nhttp://mathworld.wolfram.com/Squircle.html\n\n##### Simple Stretching (`stretch`)\n\nThis method just linearly stretches each point radially so that the rim of the circle matches the rim of the square.\n\nhttps://squircular.blogspot.com/2015/09/elliptical-arc-mapping.html\n\n##### Elliptical grid mapping (`elliptical`)\n\n\"The way I went about this was to think of a line of constant x (as well as a line of constant y) getting mapped to an ellipse in the circle\"\n\nhttps://mathproofs.blogspot.com/2005/07/mapping-square-to-circle.html\n\nhttps://squircular.blogspot.com/2015/09/mapping-circle-to-square.html\n\n##### Schwarz-Christoffel conformal mapping\n\n`raise NotImplementedError`. The math is difficult.\n\nhttps://squircular.blogspot.com/2015/09/schwarz-christoffel-mapping.html\n\nhttp://jcgt.org/published/0005/02/01/\n\n---\n\nThis code is converted from the C++ sources on Chamberlain Fong's blog posts, which (I think) is based on his paper [Analytical Methods for Squaring the Disc by C Fong 2014](https://arxiv.org/ftp/arxiv/papers/1509/1509.06344.pdf).\n\nSquircle doesn't handle ellipses/rectangles, this more recent paper should be useful: [Elliptification of Rectangular Imagery by C Fong - \u200e2017](https://arxiv.org/pdf/1709.07875.pdf)\n\n\n### Development\n\nAfter `pip install tox` you can run squircle's (limited) test set with\n\n```sh\ntox\n```\n\nOn Ubuntu, you also need the following dependencies for numpy and matplotlib\n\n```sh\nsudo apt install python3-dev libjpeg-dev zlib1g-dev libfreetype6-dev\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/verhovsky/squircle", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "squircle", "package_url": "https://pypi.org/project/squircle/", "platform": "", "project_url": "https://pypi.org/project/squircle/", "project_urls": { "Homepage": "https://github.com/verhovsky/squircle" }, "release_url": "https://pypi.org/project/squircle/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Stretch discs/circles into squares and squish squares into discs/circles", "version": "0.2.0" }, "last_serial": 5665451, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "fbe65f1e27091a6fd0c80cd41c628164", "sha256": "d33c38bef0760dd2e412d82a88db8ad900e332778b5d4023d9fed4b6753c2922" }, "downloads": -1, "filename": "squircle-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "fbe65f1e27091a6fd0c80cd41c628164", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5202, "upload_time": "2019-03-01T20:43:15", "url": "https://files.pythonhosted.org/packages/cb/54/df0d2100e738a79c3f14ff1db9b01490323a30c6559230d092eab444ceab/squircle-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "586a1d6d26e480b7a671ac4f120e803e", "sha256": "d5d7c3c1fce0d1bd5e93c9600df498688f25e048f80010772b765d1ef43d4784" }, "downloads": -1, "filename": "squircle-0.0.1.tar.gz", "has_sig": false, "md5_digest": "586a1d6d26e480b7a671ac4f120e803e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4174, "upload_time": "2019-03-01T20:43:17", "url": "https://files.pythonhosted.org/packages/04/8f/bb5737dac3b563442f6094a2bd3d9f6781aebf865f904c8ca8932e4d758d/squircle-0.0.1.tar.gz" } ], "0.1": [ { "comment_text": "", "digests": { "md5": "3f73e6d5d21e2a3ca4e1fc7b7c8a6a0c", "sha256": "9fbaafcefb860eb1089f62ab75f170adafa240d627f27d930627ef47ac6b3d22" }, "downloads": -1, "filename": "squircle-0.1.0.tar.gz", "has_sig": false, "md5_digest": "3f73e6d5d21e2a3ca4e1fc7b7c8a6a0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4287, "upload_time": "2019-08-08T04:35:00", "url": "https://files.pythonhosted.org/packages/8e/ae/150ea11ba41c321827f9519581391dc7d06cbab0fb576dce3a16c2662d0a/squircle-0.1.0.tar.gz" }, { "comment_text": "", "digests": { "md5": "f5d639b8bdbca0cb631014ae9171b4c0", "sha256": "a7dc23fc437741cf4b8d7a572d8ce5ee0bc532527e4ebaf85568ebf8e364c70e" }, "downloads": -1, "filename": "squircle-0.1-py3.7.egg", "has_sig": false, "md5_digest": "f5d639b8bdbca0cb631014ae9171b4c0", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 5688, "upload_time": "2019-03-01T20:43:19", "url": "https://files.pythonhosted.org/packages/37/4f/3a630e4dfcbc8566feb909a87772783f6c9f520dc23e7417df6c37af264b/squircle-0.1-py3.7.egg" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "3d24ba01c22623b05d231214afc5c6e6", "sha256": "8bed5744078fd8b4dcac29bec0804f87e32a17c8cb2ec0718f00263cbbae6b12" }, "downloads": -1, "filename": "squircle-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3d24ba01c22623b05d231214afc5c6e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4752, "upload_time": "2019-08-12T10:33:59", "url": "https://files.pythonhosted.org/packages/24/44/e718fd9f4e44b47a54f41b836917e51ac666da5180876748c9c149476205/squircle-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3d24ba01c22623b05d231214afc5c6e6", "sha256": "8bed5744078fd8b4dcac29bec0804f87e32a17c8cb2ec0718f00263cbbae6b12" }, "downloads": -1, "filename": "squircle-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3d24ba01c22623b05d231214afc5c6e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4752, "upload_time": "2019-08-12T10:33:59", "url": "https://files.pythonhosted.org/packages/24/44/e718fd9f4e44b47a54f41b836917e51ac666da5180876748c9c149476205/squircle-0.2.0.tar.gz" } ] }