{ "info": { "author": "Jongwook Choi", "author_email": "wookayin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "`imgcat`\n========\n\n[![pypi](https://img.shields.io/pypi/v/imgcat.svg?maxAge=86400)](https://pypi.python.org/pypi/imgcat)\n[![Build Status](https://travis-ci.org/wookayin/python-imgcat.svg?branch=master)](https://travis-ci.org/wookayin/python-imgcat)\n[![license](https://img.shields.io/github/license/wookayin/python-imgcat.svg?maxAge=86400)](LICENSE)\n\nThe imgcat CLI, written in Python (and Python API, too).\n\n\n\nIt works with [iTerm2](https://www.iterm2.com/documentation-images.html), and [even inside tmux][iterm_g3898].\n\n\nInstallation and Usage\n----------------------\n\n```\npip install imgcat\n```\n\nCommand-line interface (similar to [iTerm2's imgcat][iTerm2_imgcat]):\n\n```bash\n$ imgcat local_image.png\n$ imgcat a.png b.png c.png\n$ cat from_stdin.gif | imgcat\n\n# height is 10 lines\n$ imgcat a.png --height 10\n```\n\nPython API:\n\n```python\n>>> from imgcat import imgcat\n\n# from the content of image (e.g. buffer in python3, str in python2)\n>>> imgcat(open(\"./local_image.png\"))\n\n# or numpy arrays!\n>>> im = skimage.data.chelsea() # [300, 451, 3] ndarray, dtype=uint8\n>>> imgcat(im, height=7)\n\n# matplotlib, PIL.Image, etc.\n>>> imgcat(Image.fromarray(im))\n\n>>> import matplotlib.pyplot as plt\n>>> fig, ax = plt.subplots(); ax.plot([1, 2, 3, 4, 5])\n>>> imgcat(fig)\n```\n\nMatplotlib Backend: `module://imgcat`\n\n```python\nMPLBACKEND=\"module://imgcat\" python draw_matplotlib.py\n```\n\n```python\n>>> import matplotlib\n>>> matplotlib.use(\"module://imgcat\")\n\n>>> import matplotlib.pyplot as plt\n>>> fig, ax = plt.subplots()\n>>> ax.text(0.5, 0.5, \"Hello World!\");\n>>> fig.show()\n# an image shall be displayed on your terminal!\n```\n\nIPython magic (works both in terminal and notebook)\n\n```\n%load_ext imgcat\n%imgcat skimage.data.chelsea()\n```\n\nNotes\n-----\n\n* Currently, [tmux 2.5+ cannot display big images][tmux_gh1502]. Use tmux <= 2.4 or run outside tmux.\n* TODO: General platform/emulator support (introduce multiple backends)\n\n\nRelated Projects\n----------------\n\n* Original implementation: [imgcat][iTerm2_imgcat] from iTerm2 (limited tmux support)\n * There are modified versions with better tmux support by [Eric Dobson](https://gitlab.com/gnachman/iterm2/issues/3898#note_14097715) and by [@krtx](https://gist.github.com/krtx/533d33d6cc49ecbbb8fab0ae871059ec)\n* Node.js: [term-img](https://github.com/sindresorhus/term-img) (no tmux support)\n* Go: [iterm2-imagetools](https://github.com/olivere/iterm2-imagetools) (no tmux support)\n\n\n[iTerm2_imgcat]: https://github.com/gnachman/iTerm2/blob/master/tests/imgcat\n[tmux_gh1502]: https://github.com/tmux/tmux/issues/1502\n[iterm_g3898]: https://gitlab.com/gnachman/iterm2/issues/3898\n\n\nLicense\n-------\n\n[MIT License](LICENSE)", "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/wookayin/python-imgcat", "keywords": "imgcat iterm2 matplotlib", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "imgcat", "package_url": "https://pypi.org/project/imgcat/", "platform": "", "project_url": "https://pypi.org/project/imgcat/", "project_urls": { "Homepage": "https://github.com/wookayin/python-imgcat" }, "release_url": "https://pypi.org/project/imgcat/0.4.0/", "requires_dist": null, "requires_python": "", "summary": "imgcat as Python API and CLI", "version": "0.4.0" }, "last_serial": 5788003, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "72a882c0d85d5b3206371cc8d894023b", "sha256": "df0fdc0cf67086955742931e8ceaa625e2c10d3b892831d8bfd1a4f333bd36fd" }, "downloads": -1, "filename": "imgcat-0.1.0.tar.gz", "has_sig": false, "md5_digest": "72a882c0d85d5b3206371cc8d894023b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6153, "upload_time": "2018-10-19T20:59:02", "url": "https://files.pythonhosted.org/packages/8b/6a/dd30e4603c58dad6d1ba9c2d36dff4fbe9eead234c129e45e8ffff3b9b82/imgcat-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "093221e6b18ea8c668db99e165b19748", "sha256": "0c3efd3c4d72318c12a3a5b678a54f5187fb588c2bff82877aa7b56d04c1e800" }, "downloads": -1, "filename": "imgcat-0.1.1.tar.gz", "has_sig": false, "md5_digest": "093221e6b18ea8c668db99e165b19748", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6277, "upload_time": "2018-10-20T19:48:12", "url": "https://files.pythonhosted.org/packages/47/83/faf341343184cc762554a9d04d631bb7168fadfaf53be9872f815d040315/imgcat-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "ca27c67ae93b8d6b3b88dc095a77acba", "sha256": "a6728a4691889f426114570b262b713796f6bc60ab8a4528f4761b3ad2c07891" }, "downloads": -1, "filename": "imgcat-0.2.0.tar.gz", "has_sig": false, "md5_digest": "ca27c67ae93b8d6b3b88dc095a77acba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6474, "upload_time": "2018-11-03T09:32:31", "url": "https://files.pythonhosted.org/packages/2f/1a/a6499a7a324b7a8fa9e258c97e508c594e4a2d9d9030256741a6f5807594/imgcat-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "5e495023efb39fabd8c6a51b1b826212", "sha256": "68008138f6fba30ab27d51737389c8889232e8a1b1c5f0c392458abedfbec4e5" }, "downloads": -1, "filename": "imgcat-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5e495023efb39fabd8c6a51b1b826212", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8625, "upload_time": "2018-12-27T22:17:21", "url": "https://files.pythonhosted.org/packages/60/e8/dab903088a88ee0132240426b55ff87aebc69a958e7fb103ea70797cc21d/imgcat-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "b3ce80974df72d26ad2f5f96e38b2b1f", "sha256": "fc399988d2a82e314b2bc63298c7da3191698fa53696581a5861992c95b13971" }, "downloads": -1, "filename": "imgcat-0.4.0.tar.gz", "has_sig": false, "md5_digest": "b3ce80974df72d26ad2f5f96e38b2b1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9190, "upload_time": "2019-09-05T19:18:57", "url": "https://files.pythonhosted.org/packages/a1/ca/af20d06dba98d2a2b4bf2dc84fa28bc657f96f9690dd7d746315865c13ce/imgcat-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b3ce80974df72d26ad2f5f96e38b2b1f", "sha256": "fc399988d2a82e314b2bc63298c7da3191698fa53696581a5861992c95b13971" }, "downloads": -1, "filename": "imgcat-0.4.0.tar.gz", "has_sig": false, "md5_digest": "b3ce80974df72d26ad2f5f96e38b2b1f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9190, "upload_time": "2019-09-05T19:18:57", "url": "https://files.pythonhosted.org/packages/a1/ca/af20d06dba98d2a2b4bf2dc84fa28bc657f96f9690dd7d746315865c13ce/imgcat-0.4.0.tar.gz" } ] }