{ "info": { "author": "yuliang", "author_email": "yu.liang@thekono.com", "bugtrack_url": null, "classifiers": [], "description": "imgutil\n=======\nImage operation utility\n\n\nInstallation\n------------\n\nInstallation using pip\n\n.. code-block:: bash \n\n $ pip install imgutil\n\n\nPrerequesite\n------------\n\n* jpegtran\n* pngcrush\n\nCommand line utilities\n----------------------\n\nimgoptimize\n~~~~~~~~~~~\n\n.. code-block:: bash\n\n $ imgoptimize [-h] [-o OUTPUT] src_img\n\n* Optimize image to reduce file size.\n* Should install ``jpegtran`` and ``pngcrush``.\n\nUsage\n`````\n* ``-o``: (Optional) Specifiy the output image.\n* ``src_img``: Specify the input image.\n\nimgresize\n~~~~~~~~~\n\n.. code-block:: bash\n\n $ imgresize [-h] [-o OUTPUT] [-W WIDTH] [-H HEIGHT] src_img\n\n* Resize image by specifying width or height.\n\nUsage\n`````\n\n* ``-o``: (Optional) Specifiy the output image.\n* ``-W`` or ``--width``: (Optional) Specify the desired image width. If only width is specified, height will be determined by the aspect ratio of image.\n* ``-H`` or ``--height``: (Optional) Specify the desired image height. If only height is specified, width will be determined by the aspect ratio of image.\n* ``src_img``: Specify the input image.\n\n\nUsage\n-----\n\nimgoptimize\n~~~~~~~~~~~\n\n.. code-block:: python\n\n imgoptimize(input_filename, output_filename=None)\n\n* Should install ``jpegtran`` and ``pngcrush``.\n* It reduces jpeg/png file size.\n* It converts CMYK to RGB.\n\n**quick example**\n\n.. code-block:: python\n\n import os\n from imgutil import imgoptimize\n\n test_img = '/tmp/test.jpg'\n os.stat(test_img).st_size # 81073\n imgoptimize(test_img, '/tmp/opt.jpg') # output to /tmp/opt.jpg\n os.stat('/tmp/opt.jpg').st_size # 81026\n imgoptimize(test_img) # optimize the original file\n os.stat(test_img).st_size # 81026\n\nimgresize\n~~~~~~~~~\n\n.. code-block:: python\n\n imgresize(input_filename, width=None, height=None, output_filename=None)\n\n* It can resize image and preserve aspect ratio.\n* It can resize image to specified dimension.\n\n**quick example**\n\n.. code-block:: python\n\n from imgutil import imgresize\n\n test_img = '/tmp/test.jpg' # It is a 1024x768 image\n imgresize(test_img, width=600, output_filename='/tmp/resize.jpg') # /tmp/resize.jpg is 600x450\n imgresize(test_img, height=600, output_filename='/tmp/resize.jpg') # /tmp/resize.jpg is 800x600\n imgresize(test_img, width=100, height=100, output_filename='/tmp/resize.jpg') # /tmp/resize.jpg is 100x100\n imgresize(test_img, width=200, height=400) # /tmp/test.jpg is 200x400 now", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yu-liang-kono/imgutil", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "imgutil", "package_url": "https://pypi.org/project/imgutil/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/imgutil/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/yu-liang-kono/imgutil" }, "release_url": "https://pypi.org/project/imgutil/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "Image operation utilities.", "version": "0.1.4" }, "last_serial": 2157293, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d9e330eefe990e92a836d5a51f7b61ba", "sha256": "ed7479366ad787c8d99bd15ce07be42df99fc794e1e0e3ec8f61992b66a48882" }, "downloads": -1, "filename": "imgutil-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d9e330eefe990e92a836d5a51f7b61ba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3424, "upload_time": "2014-06-19T10:48:23", "url": "https://files.pythonhosted.org/packages/a3/23/683658740488424def9df24ebe4ea3acc141004218922cdc4d3f2151dfc0/imgutil-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "44430f2b6c33274c8d4b1e6832a194fa", "sha256": "178383a0e1007e806bf90b95663d9b7db9918a182808f9d589dbc0ac4385820a" }, "downloads": -1, "filename": "imgutil-0.1.1.tar.gz", "has_sig": false, "md5_digest": "44430f2b6c33274c8d4b1e6832a194fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3356, "upload_time": "2014-09-03T06:58:56", "url": "https://files.pythonhosted.org/packages/24/be/3740ee5780f6fed02295161ce457f9d81c8a5d5ad0c671026beaff654612/imgutil-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "9a42f6a6e03c9d1e0822a60ba5db334a", "sha256": "ac13b55de7818919f6f68d5d4efe4837bb12df2b55e736edaf8f9587ffe0723a" }, "downloads": -1, "filename": "imgutil-0.1.2.tar.gz", "has_sig": false, "md5_digest": "9a42f6a6e03c9d1e0822a60ba5db334a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3390, "upload_time": "2015-01-03T15:39:43", "url": "https://files.pythonhosted.org/packages/15/f1/36c33b7cc024d0f4ff770d7db33ef91cf809d7d0ec19a0ec15f176cd0674/imgutil-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "ad83599504152ab9e9c22e68695145a9", "sha256": "2bf9151a7cde917dc18703f5404dc5a137fdf482d06838e4523ae5f94c0973ca" }, "downloads": -1, "filename": "imgutil-0.1.3.tar.gz", "has_sig": false, "md5_digest": "ad83599504152ab9e9c22e68695145a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4078, "upload_time": "2016-03-17T09:03:28", "url": "https://files.pythonhosted.org/packages/09/a5/1061144be3bcc30db192c258b225cad0d47496d79e3e223b0605e34e29cb/imgutil-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "095f1714a8c2118e54e852b0ae0b9c6f", "sha256": "28135e79d1a209c53e2ded201086f7ed4cf4409bfea27f1613673202dcf61e63" }, "downloads": -1, "filename": "imgutil-0.1.4.tar.gz", "has_sig": false, "md5_digest": "095f1714a8c2118e54e852b0ae0b9c6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4475, "upload_time": "2016-06-08T17:43:05", "url": "https://files.pythonhosted.org/packages/a1/e7/e7e892b3453e49febba2df6d6537d6ae1cb1f0b3438f58b3374bc407a655/imgutil-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "095f1714a8c2118e54e852b0ae0b9c6f", "sha256": "28135e79d1a209c53e2ded201086f7ed4cf4409bfea27f1613673202dcf61e63" }, "downloads": -1, "filename": "imgutil-0.1.4.tar.gz", "has_sig": false, "md5_digest": "095f1714a8c2118e54e852b0ae0b9c6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4475, "upload_time": "2016-06-08T17:43:05", "url": "https://files.pythonhosted.org/packages/a1/e7/e7e892b3453e49febba2df6d6537d6ae1cb1f0b3438f58b3374bc407a655/imgutil-0.1.4.tar.gz" } ] }