{ "info": { "author": "Rasmus Scholer Sorensen", "author_email": "rasmusscholer@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Education", "Intended Audience :: End Users/Desktop", "Intended Audience :: Healthcare Industry", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: MacOS", "Operating System :: Microsoft", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Education", "Topic :: Office/Business", "Topic :: Office/Business :: Office Suites", "Topic :: Scientific/Engineering" ], "description": "\npptx-downsizer\n==============\n\nPython tool for downsizing Microsoft PowerPoint presentations (pptx)\nfiles.\n\nhttps://github.com/scholer/pptx-downsizer\n\nCurrently only supports downsizing of images (not e.g. videos and other\nmedia files).\n\n\nUse cases:\n----------\n\nWhy might someone want to downsize a Power Point presentation?\n\nIf you are like me, when you create a PowerPoint presentation, you just\nthrow in a lot of images on the slides without paying too much attention\nto how large the images are.\n\nYou may even use the \"screenshot\" feature (Cmd+shift+4 on Mac) to\nquickly capture images of whatever you have on your screen, and paste it\ninto the PowerPoint presentation (using \"Paste special\"). In which case\nyou are actually creating large TIFF images in your presentation (at\nleast for PowerPoint 2016).\n\nEven though the images in the presentation are compressed/zipped when\nsaving the presentation file, the presentation will still be\nsignificantly larger than it actually needs to be.\n\nHowever, once you realize that your presentation is 100+ MBs, you don't\nhave the time to re-save a lower-quality version of each image and then\nsubstitute that image in the presentation.\n\n*Q: What to do?*\n\n**A: First**,\n use the built-in \"Compress Pictures\" feature: Go \"File ->\n Compress pictures\", or select any image, go to the \"Picture Tools\"\n toolbar, and select the \"Compress Pictures\" icon (four arrows pointing\n to the corners of an image). This tool allows you to down-scale pictures\n and removed cropped-out areas, and can be applied to all pictures in the\n presentation at once, *but does not change the image format of pictures\n in the presentation.*\n Make sure to save your presentation under a new name, in case you realize\n you need to some of the original, uncompressed pictures!\n\n**A: Then**,\n if the presentation file size is still excessive, use ``pptx-downsizer``!\n\n``pptx-downsizer`` will go over all images in your presentation (pptx),\nand down-size all images above a certain size.\n\n- By default, all images are converted to PNG format (except for JPEGs\n which remains in JPEG format). This is particularly relevant if you\n have a lot of TIFF files in your presentation, e.g. if you copy/paste\n images or use the Mac \"screen capture\" feature when adding images.\n- You can also choose to use JPEG format (recommended only after doing\n an initial downsizing using PNG).\n- If images are more than a certain limit (default 2048 pixels) in\n either dimension (width, height), they are down-scaled to a more\n reasonable size (you most likely do not need very high-resolution\n images in your presentation, since most projectors still have a\n relatively low resolution anyways.)\n\nQ: How much can I expect ``pptx-downsizer`` to reduce my powerpoint\npresentations (pptx files)?\n\nA: If you have copy/pasted a lot of screenshots (TIFF files), it is not\nuncommon to for the presentation to be reduced to less than half (and in\nsome case one fourth) of the original file size. If you further convert\nremaining large/complex PNG images to JPEG, as a separate downsizing step,\nyou should be able to get another 20-40 percent reduction. Of course, this\nall depends on how large and complex your original images are, and how\nmuch you are willing to compromise quality when compressing your images.\nYou can use the ``--quality`` parameter to adjust quality of JPEG images.\n\n\nHow ``pptx-downsizer`` works:\n-----------------------------\n\n1. First it unzips the ``.pptx`` PowerPoint file to a temporary directory.\n Other ooxml files probably works as well, e.g. ``.docx`` Word files.\n2. Then, ``pptx-downsizer`` searches for image files with large file size.\n The file size is controlled with the ``fsize-filter`` parameter.\n It is possible to add additional file-selection filter criteria,\n e.g. set ``fname-filter=\"*.TIFF\"`` to only convert TIFF image files,\n although this is typically not needed.\n3. ``pptx-downsizer`` will then go through all selected images and try\n to minimize them in the following ways:\n\n a. If the image dimensions are larger than ``img-max-size``,\n ``pptx-downsizer`` will reduce the image dimensions (by an interger\n factor) so that the image is smaller than ``img-max-size``.\n b. The image is then resaved in the selected format (default: jpeg) and\n quality (default: 90). ``pptx-downsizer`` can also be used to change\n image modes, e.g. convert transparent regions of PNG images to a solid\n color by setting ``--img-mode=\"rgb\" --fill-color=\"#ffffff\"``.\n\n4. Finally, the ``.pptx`` PowerPoint file is re-created and re-saved as\n ``Presentation.downsized.pptx``.\n\nNote: It is often useful to do multiple rounds of downsizing, e.g. first\nconverting all large TIFF files to PNG format, then downsizing the downsized\n``pptx`` to convert the biggest PNG images to JPEG (see \"Examples\" below).\n\n\n\nExamples usage:\n---------------\n\nMake sure to save your presentation (and, preferably exit PowerPoint,\nand make a backup of your presentation just in case).\n\nLet's say you have your original, large presentation saved as\n``Presentation.pptx``\n\nAfter installing ``pptx-downsizer``, you can run the following from your\nterminal::\n\n pptx-downsizer \"Presentation.pptx\"\n\nIf you want to change the file size limit used to determine what images\nare down-sized to 1 MB (\u2248 1'000'000 bytes)::\n\n pptx-downsizer \"Presentation.pptx\" --fsize-filter 1e6\n\nIf you want to disable down-scaling of large high-resolution images, set\n``img-max-size`` to 0::\n\n pptx-downsizer \"Presentation.pptx\" --img-max-size 0\n\nIf you want to convert large images to JPEG format::\n\n pptx-downsizer \"Presentation.pptx\" --convert-to jpeg\n\n**Advanced usage:** Pause before re-creating the PowerPoint file.\nLet's say you are a power user, and you need to do something very specific\nto some or all of the images in your presentation. For instance, adding\nwatermarks before sending the presentation to someone else.\nIf you pass ``--wait-before-zip`` to ``pptx-downsizer``, the program will\nwait before it re-creates the presentation (but after downsizing the images).\n\n\n\n\nCommand line arguments:\n-----------------------\n\nYou can always get a complete description of the program and the\navailable command line arguments (parameters) by invoking::\n\n pptx-downsizer --help\n\n\nThis should produce an output similar to the following::\n\n $ pptx-downsizer --help\n usage: pptx-downsizer [-h] [--fname-filter GLOB] [--fsize-filter SIZE]\n [--convert-to IMAGE_FORMAT] [--img-max-size PIXELS]\n [--img-mode MODE] [--fill-color COLOR]\n [--quality [1-100]] [--optimize] [--no-optimize]\n [--outputfn_fmt FORMAT-STRING] [--overwrite]\n [--compress-type ZIP-TYPE] [--wait-before-zip]\n [--on-error DO-WHAT] [--verbose [0-5]]\n filename\n\n PowerPoint pptx downsizer. Reduce the file size of PowerPoint presentations by\n re-compressing images within the pptx file.\n\n positional arguments:\n filename Path to the PowerPoint pptx file that you want to\n down-size.\n\n optional arguments:\n -h, --help show this help message and exit\n --fname-filter GLOB Convert all images matching this filename pattern,\n e.g. '*.TIFF' (default: None)\n --fsize-filter SIZE Convert all images with a current file size exceeding\n this limit, e.g. '1e6' for 1 MB. (default: 524288)\n --convert-to IMAGE_FORMAT\n Convert images to this image format, e.g. `png` or\n `jpeg`. (default: png)\n --img-max-size PIXELS\n If images are larger than this size (width or height),\n reduce/downscale the image size to make it less than\n this size. (default: 2048)\n --img-mode MODE Convert images to this image mode before saving them,\n e.g. 'RGB' - advanced option. (default: None)\n --fill-color COLOR If converting image mode (e.g. from RGBA to RGB), use\n this color for transparent regions. (default: None)\n --quality [1-100] Quality of converted images (only applies to jpeg\n output). (default: 90)\n --optimize Try to optimize the converted image output when\n saving. Optimizing the output may produce better\n images, but disabling it may make the conversion run\n faster. Enabled by default. (default: True)\n --no-optimize Disable optimization. (default: False)\n --outputfn_fmt FORMAT-STRING\n How to format the downsized presentation pptx filename\n Slightly advanced, uses python string formatting.\n (default: {fnroot}.downsized.pptx)\n --overwrite Whether to silently overwrite existing file if the\n output filename already exists. (default: None)\n --compress-type ZIP-TYPE\n Which zip compression type to use, e.g. ZIP_DEFLATED,\n ZIP_BZIP2, or ZIP_LZMA. (default: ZIP_DEFLATED)\n --wait-before-zip If this flag is specified, the program will wait after\n converting all images before re-zipping the output\n pptx file. You can use this to make manual changes to\n the presentation - advanced option. (default: False)\n --on-error DO-WHAT What to do if the program encounters any errors during\n execution. `continue` will cause the program to\n continue even if one or more images fails to be\n converted. (default: raise)\n --verbose [0-5] Increase or decrease the 'verbosity' of the program,\n i.e. how much information it prints about the process.\n (default: 2)\n\n\n\nInstallation:\n-------------\n\nFirst, make sure you have Python 3+ installed. I recommend using the\nAnaconda Python distribution, which makes everything a lot easier.\n\nWith python installed, install ``pptx-downsizer`` using ``pip``::\n\n pip install pptx-downsizer\n\nYou can make sure ``pptx-downsizer`` is installed by calling it\nanywhere from the terminal / command prompt::\n\n pptx-downsizer\n\nNote: You may want to install ``pptx-downsizer`` in a\nseparate/non-default python environment. If you know what that means,\nyou already know how to do that. If you do not know what that means,\nthen don't worry\u2013you probably don't need it after all.\n\n\nTroubleshooting and bugs:\n-------------------------\n\n**NOTE:** ``pptx-downsizer`` is very early/beta software. I strongly\nrecommend to (a) *back up your presentation to a separate folder before\nrunning* ``pptx-downsizer``, and (b) *work for as long as possible in\nthe original presentation.* That way, if ``pptx-downsizer`` doesn't\nwork, you can always go back to your original presentation, and you will\nnot have lost any work.\n\nQ: HELP! I ran the downsizer and now the presentation won't open or\nPowerPoint gives errors when opening the pptx file!\n\nA: Sorry that ``pptx-downsizer`` didn't work for you. If you want, feel\nfree to send me a copy of both the presentation and the downsized pptx\nfile produced by this script, and I'll try to figure out what the\nproblem is. There are, unfortunately, a lot of things that could be\nwrong, and without the original presentation, I probably cannot diagnose\nthe issue.\n\n*OBS: If PowerPoint gives you errors when opening the downsized file,\nplease don't bother trying to fix the downsized file yourself. You may\nrun into unexpected errors later. Instead, just continue working with\nyour original presentation.*\n\nQ: Why doesn't ``pptx-downsizer`` work?\n\nA: It works for me and all the ``.pptx`` files I've thrown at it.\nHowever, there are obviously going to be a lot of scenarios that I\nhaven't run into yet.\n\nQ: Does ``pptx-downsizer`` overwrite the original presentation file?\n\nA: No, by default ``pptx-downsizer`` will create a new file with\n\".downsized\" added to the filename. If this output file already exists,\n``pptx-downsizer`` will let you know, giving you a change to (manually)\nmove/rename the existing file if you want to keep it. You can disable\nthis prompt using the ``--overwrite`` argument.\n", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/scholer/pptx-downsizer/tarball/0.1.3", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/scholer/pptx-downsizer", "keywords": "pptx", "license": "GNU General Public License v3 (GPLv3)", "maintainer": "", "maintainer_email": "", "name": "pptx-downsizer", "package_url": "https://pypi.org/project/pptx-downsizer/", "platform": "", "project_url": "https://pypi.org/project/pptx-downsizer/", "project_urls": { "Download": "https://github.com/scholer/pptx-downsizer/tarball/0.1.3", "Homepage": "https://github.com/scholer/pptx-downsizer" }, "release_url": "https://pypi.org/project/pptx-downsizer/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Tool for downsizing Microsoft PowerPoint pptx presentations.", "version": "0.1.3" }, "last_serial": 3120814, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "8669bb47afdc688f744132b05b6bd805", "sha256": "e89ffd67306d4189934f8a0fafa34d5c3336a6fc3e5c77fc9d3f05e7d8d5df1f" }, "downloads": -1, "filename": "pptx-downsizer-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8669bb47afdc688f744132b05b6bd805", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22966, "upload_time": "2017-07-18T21:50:37", "url": "https://files.pythonhosted.org/packages/17/30/f830318983ecbd54d680c309923e7bd7077b56d3ecf60d9d64b92e06f6ed/pptx-downsizer-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a16d32675011e0d5e29f05e9e81537e3", "sha256": "74b4298360e5d021c0e72e33ae4d9fbc9c3ad299d28bc7afbd78c52862bea7b7" }, "downloads": -1, "filename": "pptx-downsizer-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a16d32675011e0d5e29f05e9e81537e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29847, "upload_time": "2017-07-19T19:53:43", "url": "https://files.pythonhosted.org/packages/ff/09/db8f2579afd007c34071b4fd200122baedefbb374f31e123e7711d94a1cb/pptx-downsizer-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "0b569f3c17e1947c1bab275ce3f6a07d", "sha256": "a69724020797a72c795596760c1e2e6a12467c803e3b90281cb858cd45ba7ec9" }, "downloads": -1, "filename": "pptx-downsizer-0.1.3.tar.gz", "has_sig": false, "md5_digest": "0b569f3c17e1947c1bab275ce3f6a07d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31627, "upload_time": "2017-08-24T16:02:35", "url": "https://files.pythonhosted.org/packages/fe/69/3f163e8fd84f4faf1609c565e32cb8356a490c8a20d2aaf5ebe51ca3d265/pptx-downsizer-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0b569f3c17e1947c1bab275ce3f6a07d", "sha256": "a69724020797a72c795596760c1e2e6a12467c803e3b90281cb858cd45ba7ec9" }, "downloads": -1, "filename": "pptx-downsizer-0.1.3.tar.gz", "has_sig": false, "md5_digest": "0b569f3c17e1947c1bab275ce3f6a07d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31627, "upload_time": "2017-08-24T16:02:35", "url": "https://files.pythonhosted.org/packages/fe/69/3f163e8fd84f4faf1609c565e32cb8356a490c8a20d2aaf5ebe51ca3d265/pptx-downsizer-0.1.3.tar.gz" } ] }