{ "info": { "author": "Mark Harfouche", "author_email": "mark.harfouche@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# redpil\n\n[![pypi](https://img.shields.io/pypi/v/redpil.svg)](https://pypi.python.org/pypi/redpil)\n[![Travis](https://img.shields.io/travis/hmaarrfk/redpil.svg)](https://travis-ci.org/hmaarrfk/redpil)\n[![Docs](https://readthedocs.org/projects/redpil/badge/?version=latest)](https://redpil.readthedocs.io/en/latest/?badge=latest)\n\n\nJoin the wonderland of python, and decode all your images in a numpy compatible\nway.\n\nPillow is a great library for image manipulation. However, many operations fall\noutside what Pillow can do. As such, many scientific applications require the\nimage to be available as a numpy array. However, Pillow's memory system\nis largely incompatible with numpy's. [imageio](\nhttps://github.com/imageio/imageio) has created an efficient bridge between\nnumpy and Pillow (see benchmarks below). Unfortunately, Pillow's multitude of\noptions remain confusing it is challenging to understand how they all operate\ntogether. Furthermore, the code base is rather old, written in C, meaning that\nit is difficult to extend the functionality of existing decoders.\n\nFor large images, having to understand the details of both Pillow and numpy is a serious bottleneck.\nThe goal of the library it to read and write images in a manner natural to numpy\nusers. Images are presented as the values they hold (not indices in a color\ntable) allowing for direct data analysis.\n\nAs much as possible, the library is written in python allowing for new decoding\nalgorithms to be played around with.\n\n\n## Bitmap images\nGenerally, this library will not load memory in a C-contiguous array. Rather\nthe memory order will mostly match what was saved on disk.\n\nBitmap images will be stored in an order similar to how they arranged in\nRAM.\n\n## Supported file formats\n\nReading BMP is almost fully supported. Writing is still limited.\n\n* BMP: 1, 4, or 8bit per pixel. [Wikipedia](https://en.wikipedia.org/wiki/BMP_file_format)\n\n## Future file formats\n\n* BMP: more coverage\n* JPEG, JPEG2000\n* GIF\n* PNG\n* SVG\n* TIFF\n\n## Benchmarks\n\nI don't have a fancy benchmarking service like scikit-image or dask has, but\nhere are the benchmarks results compared to a PIL backend. This is running\non my SSD, a Samsung 960 Pro which claims it can write at 1.8GB/s. This is\npretty close to what `redpil` achieves.\n\n\n### 8 bit BMP grayscale images\n\nSaving images:\n```\n================ ============ ============ ============\n-- mode \n---------------- --------------------------------------\n shape redpil pillow imageio \n================ ============ ============ ============\n (128, 128) 93.4\u00b11\u03bcs 254\u00b130\u03bcs 369\u00b120\u03bcs \n (1024, 1024) 720\u00b130\u03bcs 936\u00b150\u03bcs 1.60\u00b10.3ms\n (2048, 4096) 5.25\u00b10.7ms 5.20\u00b10.1ms 10.4\u00b12ms \n (32768, 32768) 480\u00b110ms 489\u00b15ms 1.34\u00b10.09s\n================ ============ ============ ============\n```\n\nReading image\n```\n================ ============= ============ =============\n-- mode \n---------------- ----------------------------------------\n shape redpil pillow imageio \n================ ============= ============ =============\n (128, 128) 131\u00b15\u03bcs 293\u00b110\u03bcs 130\u00b12\u03bcs \n (1024, 1024) 194\u00b110\u03bcs 1.03\u00b10.1ms 192\u00b15\u03bcs \n (2048, 4096) 1.69\u00b10.05ms 8.55\u00b11ms 1.67\u00b10.03ms\n (32768, 32768) 350\u00b13ms 230\u00b15\u03bcs 354\u00b110ms \n================ ============= ============ =============\n```\n\nNote, Pillow refuses to read the 1GB image because it thinks it is a fork bomb.\n\n#### Patched up imageio\n\nAs it can be seen, the team at imageio/scikit-image are much better at reading\nthe pillow documentation and understanding how to use it effectively. Their\nreading speeds actually match the reading speeds of redpil, even though they\nuse pillow as a backend. They even handle what pillow thinks is a forkbomb.\n\nThrough writing this module, two bugs were found in imageio that affect\nthe speed of saving images [imageio PR #398](\nhttps://github.com/imageio/imageio/pull/398), and how images were being read\n[imageio PR #399](\nhttps://github.com/imageio/imageio/pull/399#issuecomment-433992314)\n\nWith PR 398, the saving speed of imageio+pillow now matches that of redpil.\nNote I'm always using the computer when running benchmarks, so take the exact\nnumbers with a grain of salt.\n\nSaving\n```\n================ ============ ============ ============\n-- mode \n---------------- --------------------------------------\n shape redpil pillow imageio \n================ ============ ============ ============\n (128, 128) 98.3\u00b14\u03bcs 245\u00b17\u03bcs 350\u00b14\u03bcs \n (1024, 1024) 714\u00b120\u03bcs 921\u00b130\u03bcs 997\u00b120\u03bcs \n (2048, 4096) 4.83\u00b10.3ms 5.30\u00b10.4ms 5.26\u00b10.2ms\n (32768, 32768) 520\u00b140ms 516\u00b130ms 489\u00b19ms \n================ ============ ============ ============\n```\n\nReading\n```\n================ ============= ============ =============\n-- mode \n---------------- ----------------------------------------\n shape redpil pillow imageio \n================ ============= ============ =============\n (128, 128) 129\u00b10.7\u03bcs 284\u00b12\u03bcs 129\u00b10.7\u03bcs \n (1024, 1024) 191\u00b12\u03bcs 1.12\u00b10.1ms 190\u00b10.9\u03bcs \n (2048, 4096) 1.62\u00b10.03ms 8.88\u00b11ms 1.63\u00b10.02ms\n (32768, 32768) 357\u00b19ms 223\u00b14\u03bcs 361\u00b18ms \n================ ============= ============ =============\n```\n\n\n# History\n\n## 0.0.1 (2018-09-22)\n\n* First release on PyPI.\n\n\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/hmaarrfk/redpil", "keywords": "redpil", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "redpil", "package_url": "https://pypi.org/project/redpil/", "platform": "", "project_url": "https://pypi.org/project/redpil/", "project_urls": { "Homepage": "https://github.com/hmaarrfk/redpil" }, "release_url": "https://pypi.org/project/redpil/0.0.5/", "requires_dist": [ "numpy" ], "requires_python": "", "summary": "Join the wonderland of python, and decode all your images in a numpy compatible way", "version": "0.0.5" }, "last_serial": 5531485, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "49117c4110f184eb06364ed4c8edd04f", "sha256": "0e6d7ffb4cc904624166676765bc529dec4471c11a02a1d474555a5a553c6f53" }, "downloads": -1, "filename": "redpil-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "49117c4110f184eb06364ed4c8edd04f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6140, "upload_time": "2018-10-29T02:11:41", "url": "https://files.pythonhosted.org/packages/0b/70/8a8151c207e6fdd7ee71e9cc7866ff5a0302bef5e1a24ae8f242a1a5ccb0/redpil-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "630f37bec333b8265f6836f6fbbb9b5e", "sha256": "2664a7ed0f1252decd43fb9ae96618b9c0d748795b735847084483c6b3de681d" }, "downloads": -1, "filename": "redpil-0.0.1.tar.gz", "has_sig": false, "md5_digest": "630f37bec333b8265f6836f6fbbb9b5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27126, "upload_time": "2018-10-29T02:11:42", "url": "https://files.pythonhosted.org/packages/5b/f4/3ee742993396e98220d81354a52c5e2132c9674068207f35a04a503887cc/redpil-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "86526d4bd8bf3f9fb1099a2b77765f60", "sha256": "74cc977b265534bdaadbd4a9b2a75eed6c92ce6d24a9fafc9fd910b977794569" }, "downloads": -1, "filename": "redpil-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "86526d4bd8bf3f9fb1099a2b77765f60", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6164, "upload_time": "2018-10-29T02:15:33", "url": "https://files.pythonhosted.org/packages/d6/55/a673c75ca3bd55de0a8a08da550f01e6cb00287a4599d95dfcf42522a01f/redpil-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b5324c17a26be1b6bbb2e637515d2699", "sha256": "f2fc1bd1fa5a29d220546c5253385f5fa735692ae0b3b62f37367c1acf16eec4" }, "downloads": -1, "filename": "redpil-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b5324c17a26be1b6bbb2e637515d2699", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27170, "upload_time": "2018-10-29T02:15:34", "url": "https://files.pythonhosted.org/packages/d0/af/98e7f6121fcd5d4976d457d20c0aba3c03d00bd1707daa8874841a282aa7/redpil-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "46bddbf9706ccb3d66fc52b59f9b4fea", "sha256": "1ea1e278e187a9dfbda2233f8aca54c4baa31f980c1d6b8a0ed31cb96a410c11" }, "downloads": -1, "filename": "redpil-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "46bddbf9706ccb3d66fc52b59f9b4fea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9419, "upload_time": "2018-10-30T14:22:44", "url": "https://files.pythonhosted.org/packages/1b/18/a9ba0acb71ee572b9fc54c1315d1434e11bde96d20125f173566ac185200/redpil-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8324f3e8d91c28a64819f5ceab3c8d11", "sha256": "344e0dd2909f3e52cd63a5c7c900b0d1a3475a47db4929bee4dcfe49451c28c3" }, "downloads": -1, "filename": "redpil-0.0.4.tar.gz", "has_sig": false, "md5_digest": "8324f3e8d91c28a64819f5ceab3c8d11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32193, "upload_time": "2018-10-30T14:22:46", "url": "https://files.pythonhosted.org/packages/38/7d/b6aec831c0c014509e949e00c29bc44bcfcda8f5bb1b8e9e57d53c637c49/redpil-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "017c22ba550bd70d129b82d3b66e8d8b", "sha256": "e49df7bd6991c56bcd66ea472da62bfe8d8e84e06d1f9f077641fb133b0297ed" }, "downloads": -1, "filename": "redpil-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "017c22ba550bd70d129b82d3b66e8d8b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11138, "upload_time": "2019-07-14T16:35:18", "url": "https://files.pythonhosted.org/packages/69/13/671b4877088a0c24487f78fd1fb28461e902804e80ade9cf8f46a52071aa/redpil-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c889601333162f0e58a9db98f9f70f0", "sha256": "a6a47db772864ab17cd5590c29cf79e622e9846aae95660469b8bdde93909001" }, "downloads": -1, "filename": "redpil-0.0.5.tar.gz", "has_sig": false, "md5_digest": "9c889601333162f0e58a9db98f9f70f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32852, "upload_time": "2019-07-14T16:35:19", "url": "https://files.pythonhosted.org/packages/92/b4/817aed138ca08e0edb426d797c6743aeab72a4d8b3c981d0d76463b3c126/redpil-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "017c22ba550bd70d129b82d3b66e8d8b", "sha256": "e49df7bd6991c56bcd66ea472da62bfe8d8e84e06d1f9f077641fb133b0297ed" }, "downloads": -1, "filename": "redpil-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "017c22ba550bd70d129b82d3b66e8d8b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11138, "upload_time": "2019-07-14T16:35:18", "url": "https://files.pythonhosted.org/packages/69/13/671b4877088a0c24487f78fd1fb28461e902804e80ade9cf8f46a52071aa/redpil-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9c889601333162f0e58a9db98f9f70f0", "sha256": "a6a47db772864ab17cd5590c29cf79e622e9846aae95660469b8bdde93909001" }, "downloads": -1, "filename": "redpil-0.0.5.tar.gz", "has_sig": false, "md5_digest": "9c889601333162f0e58a9db98f9f70f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 32852, "upload_time": "2019-07-14T16:35:19", "url": "https://files.pythonhosted.org/packages/92/b4/817aed138ca08e0edb426d797c6743aeab72a4d8b3c981d0d76463b3c126/redpil-0.0.5.tar.gz" } ] }