{ "info": { "author": "Eric Moritz", "author_email": "eric@themoritzfamily.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python :: Implementation :: Stackless", "Topic :: Multimedia :: Graphics" ], "description": "===================================================================\nboxmath\n===================================================================\n\nThis provides image crop/resize algorithm for chaining multiple resize,\ncrop actions and producing a resulting crop/resize action pair.\n\n-------------------------------------------------------------------\nUsage\n-------------------------------------------------------------------\n\nThe usage is fairly simple:\n\n.. code:: python\n\n from boxmath import box, resize, crop, size, make_transformer\n from wand import image\n \n # Load the image to get its width and height\n i = image.Image(filename=\"chrysanthemum.jpg\")\n b = box(i.width, i.height)\n \n # manipulate the virtual image\n b = resize(b, 629, 483)\n b = crop(b, 0, 0, 480, 480)\n b = resize(b, 1000, 1000)\n \n # render\n def resizer(img, w, h):\n img.resize(int(w), int(h), filter=FILTER)\n return img\n\n def cropper(img, l,t,r,b):\n img.crop(int(l),int(t),int(r),int(b))\n return img\n \n t = make_transformer(b, resizer, cropper)\n i = t(i)\n i.save(filename=\"chrysanthemum-1000x1000.jpg\")\n\n\nNormally, if we would of used wand or PIL directly, each resize would\ndegrade the image. The action of down scaling and then up scaling\nwould wreck the quality of the image; with the power of math, we\nonly apply the resize and crop when we need render the image.\n\nNot that the width, height, left, top, right, and bottom values\npassed to the resizer and cropper functions are cast as ints.\n\nThis is because they are either fractions.Fraction() instances or\nint(). `boxmath` uses the Fraction class to ensure precision while\nresizing and cropping.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/ericmoritz/boxmath", "keywords": null, "license": "BSD License", "maintainer": null, "maintainer_email": null, "name": "boxmath", "package_url": "https://pypi.org/project/boxmath/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/boxmath/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/ericmoritz/boxmath" }, "release_url": "https://pypi.org/project/boxmath/0.1.3/", "requires_dist": null, "requires_python": null, "summary": "Simple image box arithmetic", "version": "0.1.3" }, "last_serial": 833542, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "007c3b2e019cd879209c8dd14849ffa6", "sha256": "560a56eab507b6907aced6d9689331688915d675babc45dedd4ee9948f1a5db4" }, "downloads": -1, "filename": "boxmath-0.1.0.tar.gz", "has_sig": false, "md5_digest": "007c3b2e019cd879209c8dd14849ffa6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9643, "upload_time": "2013-06-20T17:21:04", "url": "https://files.pythonhosted.org/packages/f2/3e/e4137fd00fd803e16bf0c01f44d80eabf0613dd8d37417dfe8375fe4bb90/boxmath-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "64f7d88390946c616b2cae0112475e6b", "sha256": "2188d359206ec179eb88e3d935223bb859dcd06af2f841706bd309b46a6da16a" }, "downloads": -1, "filename": "boxmath-0.1.1.tar.gz", "has_sig": false, "md5_digest": "64f7d88390946c616b2cae0112475e6b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9141, "upload_time": "2013-07-17T21:46:37", "url": "https://files.pythonhosted.org/packages/c0/e7/bd51618e552b2ef53f802775da24a482a021f998d7bb571041e17bb44773/boxmath-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "17f9b28e995ffbf2749777a0c2531a56", "sha256": "360a2174183e830030c81ba547222baed89373c03be1b49fb380b63cdbe1be19" }, "downloads": -1, "filename": "boxmath-0.1.2.tar.gz", "has_sig": false, "md5_digest": "17f9b28e995ffbf2749777a0c2531a56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9155, "upload_time": "2013-07-18T22:00:01", "url": "https://files.pythonhosted.org/packages/74/3a/1a4d1765d09e48e45adcdbfd665b0a62db98a42a726e384faf1551c44ac2/boxmath-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6a5224211f8f146fc1d205449e882ed5", "sha256": "b27ea9301d1902c3202699ddcdaf829c646551e23d0c1f9a5124b4fde2005107" }, "downloads": -1, "filename": "boxmath-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6a5224211f8f146fc1d205449e882ed5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9214, "upload_time": "2013-08-06T14:54:57", "url": "https://files.pythonhosted.org/packages/78/f3/0d87d662e368370909bbf80e9f662c9a846475aabfb9af7e157fcedf1ce1/boxmath-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6a5224211f8f146fc1d205449e882ed5", "sha256": "b27ea9301d1902c3202699ddcdaf829c646551e23d0c1f9a5124b4fde2005107" }, "downloads": -1, "filename": "boxmath-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6a5224211f8f146fc1d205449e882ed5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9214, "upload_time": "2013-08-06T14:54:57", "url": "https://files.pythonhosted.org/packages/78/f3/0d87d662e368370909bbf80e9f662c9a846475aabfb9af7e157fcedf1ce1/boxmath-0.1.3.tar.gz" } ] }