{"id":15658672,"url":"https://github.com/slhck/compress-pptx","last_synced_at":"2025-05-01T10:13:09.197Z","repository":{"id":51742425,"uuid":"333044886","full_name":"slhck/compress-pptx","owner":"slhck","description":"Compress a PPTX file, converting all PNG/TIFF images to lossy JPEGs","archived":false,"fork":false,"pushed_at":"2023-10-02T19:15:25.000Z","size":1676,"stargazers_count":27,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-01T10:13:01.921Z","etag":null,"topics":["pptx","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slhck.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-26T10:12:21.000Z","updated_at":"2025-04-24T08:11:45.000Z","dependencies_parsed_at":"2024-10-23T08:54:51.083Z","dependency_job_id":null,"html_url":"https://github.com/slhck/compress-pptx","commit_stats":{"total_commits":50,"total_committers":3,"mean_commits":"16.666666666666668","dds":0.12,"last_synced_commit":"a67bdb055ab7fd1f1d0b5e50075d0bf9faf5ed45"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slhck%2Fcompress-pptx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slhck%2Fcompress-pptx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slhck%2Fcompress-pptx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slhck%2Fcompress-pptx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slhck","download_url":"https://codeload.github.com/slhck/compress-pptx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251857021,"owners_count":21655121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pptx","python"],"created_at":"2024-10-03T13:13:25.555Z","updated_at":"2025-05-01T10:13:09.168Z","avatar_url":"https://github.com/slhck.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compress-pptx\n\n[![PyPI version](https://img.shields.io/pypi/v/compress-pptx.svg)](https://pypi.org/project/compress-pptx)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\nCompress a PPTX or POTX file, converting all PNG/TIFF images to lossy JPEGs.\n\n## What it does\n\nWhen copy-pasting images to PowerPoint presentations, these sometimes get inserted as lossless versions, blowing up the size of the presentation.\n\nThis script takes all PNG or TIFF images part of the presentation which are larger than a given threshold (1 MiB by default), converts them to a lossy JPEG variant, and creates a new PPTX file.\n\n:warning: This is not the same as compressing images with PowerPoint's own functionality. You may still need to do this to reduce the size of your presentation!\n\nPNGs containing transparency can be skipped to prevent graphics issues. Normally their transparent parts are replaced with white (although you can choose another color).\n## Requirements\n\n- Operating system: macOS or Linux\n  - Note: Under Linux, you need LibreOffice installed to convert embedded EMF files\n- Python 3.8 or higher\n- ImageMagick's `magick` commands (`magick convert` and `magick identify`)\n- Optionally: `ffmpeg` for media files, and\n\nUnder Ubuntu, get ImageMagick via:\n\n```\napt install imagemagick\n```\n\nUnder macOS, install it with [Homebrew](https://brew.sh):\n\n```\nbrew install imagemagick\n```\n\nFor ffmpeg, use the static builds from [ffmpeg.org](https://ffmpeg.org/downloads.html).\n\n## Installation\n\nVia pip:\n\n```\npip3 install --user compress-pptx\n```\n\n## Usage\n\nCall `compress-pptx` and point it to a PPTX or POTX file. It'll compress the images and output another compressed file next to it.\n\nFor more options, see the `-h` output:\n\n```\nusage: compress-pptx [-h] [-o OUTPUT] [-s SIZE] [-q QUALITY] [-t TRANSPARENCY]\n                     [-k] [-v] [-f] [-m] [-j] [-l] [--num-cpus NUM_CPUS]\n                     input\n\npositional arguments:\n  input\n\noptions:\n  -h, --help            show this help message and exit\n  -o OUTPUT, --output OUTPUT\n                        Output file (default: None)\n  -s SIZE, --size SIZE  Minimum size threshold in bytes. Also accepts the\n                        suffixes k/M/G or KiB/MiB/GiB (default: 1MiB)\n  -q QUALITY, --quality QUALITY\n                        JPEG output quality (0-100) (default: 85)\n  -t TRANSPARENCY, --transparency TRANSPARENCY\n                        Replace transparency with color (default: white)\n  -k, --skip-transparent-images\n                        Skip converting transparent images at all (default:\n                        False)\n  -v, --verbose         Show additional info (default: False)\n  -f, --force           Force overwriting output file (default: False)\n  -m, --compress-media  Compress other media types such as audio and video\n                        (requires ffmpeg) (default: False)\n  -j, --recompress-jpeg\n                        Recompress jpeg images (default: False)\n  -l, --use-libreoffice\n                        Use LibreOffice to compress EMF files (only way to\n                        compress EMF files under Linux) (default: False)\n  --num-cpus NUM_CPUS   Number of CPUs to use (default: all available CPUs)\n```\n\n## Bash Version\n\nThere's an unmaintained Bash version under `bash/compress-pptx.sh`.\n\n## Contributors\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/caydey\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/63204672?v=4?s=100\" width=\"100px;\" alt=\"caydey\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ecaydey\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/slhck/compress-pptx/commits?author=caydey\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\n## License\n\nMIT License\n\nCopyright (c) 2021-2023 Werner Robitza\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslhck%2Fcompress-pptx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslhck%2Fcompress-pptx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslhck%2Fcompress-pptx/lists"}