{ "info": { "author": "Hideo Hattori", "author_email": "hhatto.jp@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Utilities" ], "description": ".. image:: https://travis-ci.com/smartcrop/smartcrop.py.svg?branch=master\n :target: https://travis-ci.com/smartcrop/smartcrop.py\nsmartcrop.py\n============\nsmartcrop implementation in Python\n\nsmartcrop finds good crops for arbitrary images and crop sizes, based on Jonas Wagner's `smartcrop.js`_\n\n.. _`smartcrop.js`: https://github.com/jwagner/smartcrop.js\n\n.. image:: https://i.gyazo.com/c602d20e025e58f5b15180cd9a262814.jpg\n :width: 50%\n\n.. image:: https://i.gyazo.com/5fbc9026202f54b13938de621562ed3d.jpg\n :width: 25%\n\n.. image:: https://i.gyazo.com/88ee22ca9e1dd7e9eba7ea96db084e5e.jpg\n :width: 50%\n\nRequirements\n------------\n* PIL or Pillow\n\n\nInstallation\n------------\n.. code-block:: sh\n\n pip install --upgrade git+https://github.com/hhatto/smartcrop.py.git\n\n\nUsage\n-----\ncommand-line tool\n\n.. code-block:: sh\n\n smartcrop.py FILE\n\nuse module\n\n.. code-block:: python\n\n import sys\n import json\n from PIL import Image\n import smartcrop\n\n sc = smartcrop.SmartCrop()\n crop_options = smartcrop.DEFAULTS\n crop_options['width'] = 100\n crop_options['height'] = 100\n\n img = Image.open(sys.argv[1])\n ret = sc.crop(img, crop_options)\n print(json.dumps(ret, indent=2))\n\n\nsmartcrop.py is slower than `smartcrop.js`_\n\n.. code-block:: sh\n\n $ identify images/t.jpg\n images/t.jpg JPEG 3200x2403 3200x2403+0+0 8-bit DirectClass 2.066MB 0.000u 0:00.000\n $ time smartcrop --width 300 --height 300 images/t.jpg\n smartcrop --width 300 --height 300 images/t.jpg 0.30s user 0.11s system 100% cpu 0.414 total\n $ time smartcroppy --width 300 --height 300 images/t.jpg\n smartcroppy --width 300 --height 300 images/t.jpg 3.74s user 0.31s system 99% cpu 4.051 total\n\nLicense\n-------\nMIT\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/smartcrop/smartcrop.py", "keywords": "image,crop,PIL,Pillow", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "smartcrop", "package_url": "https://pypi.org/project/smartcrop/", "platform": "any", "project_url": "https://pypi.org/project/smartcrop/", "project_urls": { "Homepage": "https://github.com/smartcrop/smartcrop.py" }, "release_url": "https://pypi.org/project/smartcrop/0.2.1/", "requires_dist": [ "Pillow (>=4.3.*)" ], "requires_python": "", "summary": "smartcrop implementation in Python", "version": "0.2.1" }, "last_serial": 4741650, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "8e3e151a6bed70279cb292fd47e3b57d", "sha256": "d08d63752827a073acbedf158afa19514a976bcaf48beed659226db16b302b74" }, "downloads": -1, "filename": "smartcrop-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8e3e151a6bed70279cb292fd47e3b57d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7075, "upload_time": "2019-01-25T20:31:26", "url": "https://files.pythonhosted.org/packages/bd/68/193a7fd4ead94d94cbfb765a7da39cf0ebf05565038b2482434be62ca11f/smartcrop-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "564ffcce441d3b33cf2542c6a73f2831", "sha256": "4cab82a3a0d31b3b39176f71639323fcded2996ccf998c8953f8365c6d1acccb" }, "downloads": -1, "filename": "smartcrop-0.2.1.tar.gz", "has_sig": false, "md5_digest": "564ffcce441d3b33cf2542c6a73f2831", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5736, "upload_time": "2019-01-25T20:31:29", "url": "https://files.pythonhosted.org/packages/6c/1d/eea655e9b8efdcf282e3d41b27a6e85b3f235000641d9e4b1b9624668ba9/smartcrop-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e3e151a6bed70279cb292fd47e3b57d", "sha256": "d08d63752827a073acbedf158afa19514a976bcaf48beed659226db16b302b74" }, "downloads": -1, "filename": "smartcrop-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8e3e151a6bed70279cb292fd47e3b57d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7075, "upload_time": "2019-01-25T20:31:26", "url": "https://files.pythonhosted.org/packages/bd/68/193a7fd4ead94d94cbfb765a7da39cf0ebf05565038b2482434be62ca11f/smartcrop-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "564ffcce441d3b33cf2542c6a73f2831", "sha256": "4cab82a3a0d31b3b39176f71639323fcded2996ccf998c8953f8365c6d1acccb" }, "downloads": -1, "filename": "smartcrop-0.2.1.tar.gz", "has_sig": false, "md5_digest": "564ffcce441d3b33cf2542c6a73f2831", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5736, "upload_time": "2019-01-25T20:31:29", "url": "https://files.pythonhosted.org/packages/6c/1d/eea655e9b8efdcf282e3d41b27a6e85b3f235000641d9e4b1b9624668ba9/smartcrop-0.2.1.tar.gz" } ] }