{ "info": { "author": "Andreas Bunkahle", "author_email": "abunkahle@t-online.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# gif2numpy Version 1.3\nPython library to convert single oder multiple frame gif images to numpy images or to OpenCV without PIL or pillow. OpenCV does not support gif images.\n\nInstall it with \n\n setup.py install\n \nor with\n\n pip install gif2numpy\n \n# Usage\n\nYou can use the library this way:\n\n from __future__ import print_function\n import gif2numpy\n import cv2\n \n images = \"Images/Rotating_earth.gif\", \"Images/hopper.gif\", \"Images/audrey.gif\", \"Images/testcolors.gif\"\n for image in images:\n frames, exts, image_specs = gif2numpy.convert(image)\n print()\n print(\"Image:\", image)\n print()\n print(\"len frames\", len(frames))\n print(\"len exts\", len(exts))\n print(\"exts:\", exts)\n print(\"image_specs:\", image_specs)\n for i in range(len(frames)):\n cv2.imshow(\"np_image\", frames[i])\n k = cv2.waitKey(0)\n if k == 27:\n break\n cv2.destroyWindow(\"np_image\")\n \nThere is also the class Gif inside the module which can be used to determine Gif features inside the image.\nThe general features are given in the dictionary image_specs.\nIf multiple frames are saved in the gif you can retrieve them in the list of frames. The list of exts with the same index number as in frames gives you the specifications of each frame (block_size, flags, delay_time, transparent_idx, terminator, lzw_min, \ntop, left, width, height, has_color_table, local_color_table).\n\nBy default this module was designed for the connection with cv2 which has the BGR(A) color mapping sequence for the color tuples. In case you are not using opencv and its color mapping you should set the color conversion flag BGR2RGB to False so that no color conversion takes place. So use the module like that:\n\n from __future__ import print_function\n import gif2numpy\n import cv2\n \n images = \"Images/Rotating_earth.gif\", \"Images/hopper.gif\", \"Images/audrey.gif\", \"Images/testcolors.gif\"\n for image in images:\n frames, exts, image_specs = gif2numpy.convert(image, BGR2RGB=False)\n print()\n print(\"Image:\", image)\n print()\n print(\"len frames\", len(frames))\n print(\"len exts\", len(exts))\n print(\"exts:\", exts)\n print(\"image_specs:\", image_specs)\n for i in range(len(frames)):\n cv2.imshow(\"np_image\", frames[i])\n k = cv2.waitKey(0)\n if k == 27:\n break\n cv2.destroyWindow(\"np_image\")\n\n# Version history\n\n1.3: Additional flag for BGR2RGB conversion, by default this flag is set and a BGR2RGB color conversion takes place, better time optimization of color table mapping\n\n1.2: Bug fix for multiple frame gif images, pixel error in frames fixed\n\n1.1: single frame and multiple frame gif images are now supported\n\n1.0: first release just for still single images\n\n# Dependencies\n\nYou need to install numpy and kaitaistruct by:\n\n pip install numpy kaitaistruct", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bunkahle/gif2numpy", "keywords": "GIF Converter Numpy", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "gif2numpy", "package_url": "https://pypi.org/project/gif2numpy/", "platform": "any", "project_url": "https://pypi.org/project/gif2numpy/", "project_urls": { "Homepage": "https://github.com/bunkahle/gif2numpy" }, "release_url": "https://pypi.org/project/gif2numpy/1.3/", "requires_dist": null, "requires_python": "", "summary": "Convert single and multiple frame gif images to numpy images or to OpenCV without PIL or pillow", "version": "1.3" }, "last_serial": 5191332, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "f25a03c9b0225e96889e3e2eab35532f", "sha256": "31135bbab0c1123b91a1b028e6133f413608a0a93b99b8613b7a71c3233e7576" }, "downloads": -1, "filename": "gif2numpy-1.0.zip", "has_sig": false, "md5_digest": "f25a03c9b0225e96889e3e2eab35532f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7221, "upload_time": "2019-04-15T04:53:22", "url": "https://files.pythonhosted.org/packages/0e/26/587da5732bceed840fed25f09982a9b5e5fa2db4234cd9bff3d48e41e34e/gif2numpy-1.0.zip" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "553275877906cd4f68c5b8921fe86be3", "sha256": "6ed25b241921ded704c06b52b624a01e94e72d78b851852eba6736fd708213bb" }, "downloads": -1, "filename": "gif2numpy-1.1.zip", "has_sig": false, "md5_digest": "553275877906cd4f68c5b8921fe86be3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8343, "upload_time": "2019-04-21T11:37:22", "url": "https://files.pythonhosted.org/packages/e6/02/59edff6e3a84afc8f31d623e4d169fdc17c661219a944a29ce405e6882f5/gif2numpy-1.1.zip" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "eeafb3a167b2d4eab6df69baff438ff7", "sha256": "31de629ae700426bb71d1c0aea8694956ec2b0f0d04a90f3ba7eef93bb65fb9f" }, "downloads": -1, "filename": "gif2numpy-1.2.zip", "has_sig": false, "md5_digest": "eeafb3a167b2d4eab6df69baff438ff7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9036, "upload_time": "2019-04-24T05:16:26", "url": "https://files.pythonhosted.org/packages/c2/39/78bf40a5a08d1da2e882d4e82971ae2ea87c1ce80e976d56a716b3ac7825/gif2numpy-1.2.zip" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "efd0fb372d6111fbfe330f137463419b", "sha256": "597d9f03c0263fff6a0ba9b2ff688c8a0e4d2f888b861ce10987251020a9b544" }, "downloads": -1, "filename": "gif2numpy-1.3.zip", "has_sig": false, "md5_digest": "efd0fb372d6111fbfe330f137463419b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10032, "upload_time": "2019-04-26T06:58:49", "url": "https://files.pythonhosted.org/packages/e6/e7/beab1c356898b1d7318d3f245d38df0d35c3cb7eb45ff5904b1bcaca5097/gif2numpy-1.3.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "efd0fb372d6111fbfe330f137463419b", "sha256": "597d9f03c0263fff6a0ba9b2ff688c8a0e4d2f888b861ce10987251020a9b544" }, "downloads": -1, "filename": "gif2numpy-1.3.zip", "has_sig": false, "md5_digest": "efd0fb372d6111fbfe330f137463419b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10032, "upload_time": "2019-04-26T06:58:49", "url": "https://files.pythonhosted.org/packages/e6/e7/beab1c356898b1d7318d3f245d38df0d35c3cb7eb45ff5904b1bcaca5097/gif2numpy-1.3.zip" } ] }