{ "info": { "author": "Adam Geitgey", "author_email": "ageitgey@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3" ], "description": "# image_to_numpy\n\nLoad an image file into a numpy array - while automatically rotating the image based on \nExif orientation. Prevents upside-down and sideways images! \n\n```\nimport image_to_numpy\n\nimg = image_to_numpy.load_image_file(\"my_file.jpg\")\n```\n\nThe image is automatically rotated into the correct orientation if the image contains Exif orientation metadata.\nOtherwise, it is loaded normally.\n\nFrom there, you can pass the numpy array to any Python library that works with images\nin numpy array format, like face_recognition, Keras, etc.\n\n## Installation\n\nYou can install from [PyPI](https://pypi.org/project/image_to_numpy/):\n\n pip install image_to_numpy\n\n## Usage\n\n ```python\nimport image_to_numpy\n\nimg = image_to_numpy.load_image_file(\"my_file.jpg\")\n```\n\nYour image is loaded - with the correct orientation! \n\nBy default, the image array is returned as a numpy array \nwith 3-channels of 8-bit RGB data.\n\nYou can control the output format by passing in an optional `mode` parameter:\n\n ```python\nimport image_to_numpy\n\nimg = image_to_numpy.load_image_file(\"my_file.jpg\", mode=\"RGB\")\n\n# Supported modes:\n# 1 (1-bit pixels, black and white, stored with one pixel per byte)\n# L (8-bit pixels, black and white)\n# RGB (3x8-bit pixels, true color)\n# RGBA (4x8-bit pixels, true color with transparency mask)\n# CMYK (4x8-bit pixels, color separation)\n# YCbCr (3x8-bit pixels, color video format)\n# I (32-bit signed integer pixels)\n# F (32-bit floating point pixels)\n```\n\n\nIf you have matplotlib installed, here's a quick way to show your image\non the screen:\n\n```python\nimport matplotlib.pyplot as plt\nimport image_to_numpy\n\nimg = image_to_numpy.load_image_file(\"my_file.jpg\")\n\nplt.imshow(img)\nplt.show()\n```\n\n## Thanks\n\n- EXIF test images used in the unittests created by Dave Perrett / @daveperrett\n - https://github.com/recurser/exif-orientation-examples", "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/ageitgey/image_to_numpy", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "image-to-numpy", "package_url": "https://pypi.org/project/image-to-numpy/", "platform": "", "project_url": "https://pypi.org/project/image-to-numpy/", "project_urls": { "Homepage": "https://github.com/ageitgey/image_to_numpy" }, "release_url": "https://pypi.org/project/image-to-numpy/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Load an image into a numpy array with proper Exif orientation handling", "version": "1.0.0" }, "last_serial": 5950096, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "3ef15bedaa10782c1d5c1b07fb512f20", "sha256": "1fd1da99b3b451d8bcf2aae21d184be9ef5745facf099fd23fcecf224675c791" }, "downloads": -1, "filename": "image_to_numpy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3ef15bedaa10782c1d5c1b07fb512f20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2988, "upload_time": "2019-10-09T14:18:25", "url": "https://files.pythonhosted.org/packages/b9/76/5f1068fe491b011e9625f1da73f2d5c00e9d810dce39253ba6bcf886ac79/image_to_numpy-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3ef15bedaa10782c1d5c1b07fb512f20", "sha256": "1fd1da99b3b451d8bcf2aae21d184be9ef5745facf099fd23fcecf224675c791" }, "downloads": -1, "filename": "image_to_numpy-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3ef15bedaa10782c1d5c1b07fb512f20", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2988, "upload_time": "2019-10-09T14:18:25", "url": "https://files.pythonhosted.org/packages/b9/76/5f1068fe491b011e9625f1da73f2d5c00e9d810dce39253ba6bcf886ac79/image_to_numpy-1.0.0.tar.gz" } ] }