# slidecompress
A command-line tool that reduces PowerPoint file sizes by intelligently compressing embedded images while maintaining visual quality.
## Features
- Automatically resizes large images to reasonable dimensions (1000x1000 max)
- Optimizes PNG files by reducing colors to 255 while maintaining quality
- Compresses JPEG files with balanced quality settings (75% quality)
- Converts TIF/TIFF/EMF files to optimized PNGs
- Preserves original files by creating a new `.compressed.pptx` file
- Shows detailed compression statistics for each image
- Reports which slides contain the largest remaining images
## Requirements
- Python 3.6+
- ImageMagick (`magick` command must be available in PATH)
## Usage
First, [compress all images in PowerPoint](https://support.microsoft.com/en-us/office/reduce-the-file-size-of-your-powerpoint-presentations-9548ffd4-d853-41e7-8e40-b606bca036b4).
Then, run the tool:
```bash
uvx slidecompress presentation.pptx
```
Or with custom maximum image width:
```bash
uvx slidecompress --width 480 presentation.pptx
```
The compressed file will be saved as `presentation.compressed.pptx` in the same directory.
To overwrite the original file, use the `-f` flag:
```bash
uvx slidecompress -f presentation.pptx
```
## Example Output
```
image1.png: 9.7KB compressed by 1.4KB
image2.png: 4.5KB
image3.jpeg: 19.6KB compressed by 2.3KB
image4.emf: 98.2KB compressed by 25.3KB and converted to .png
Largest media after compression:
image4.emf: 72.9KB in slide 4
image3.jpeg: 17.3KB in slide 3
image1.png: 8.3KB in slide 1
image2.png: 4.5KB in slide 2
```
## Build
To build and upload to PyPI:
1. Update the version in `pyproject.toml`
2. Build and upload the package
```
rm -rf dist/
uvx --from build pyproject-build
uvx twine upload -u __token__ dist/*
```
## License
MIT
Raw data
{
"_id": null,
"home_page": null,
"name": "slidecompress",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "compression, images, optimization, powerpoint",
"author": null,
"author_email": "S Anand <root.node@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/25/ca/9caca433b90f9cd5bc6371d477824dc03a248a03da6738b76b623f8518eb/slidecompress-0.1.3.tar.gz",
"platform": null,
"description": "# slidecompress\n\nA command-line tool that reduces PowerPoint file sizes by intelligently compressing embedded images while maintaining visual quality.\n\n## Features\n\n- Automatically resizes large images to reasonable dimensions (1000x1000 max)\n- Optimizes PNG files by reducing colors to 255 while maintaining quality\n- Compresses JPEG files with balanced quality settings (75% quality)\n- Converts TIF/TIFF/EMF files to optimized PNGs\n- Preserves original files by creating a new `.compressed.pptx` file\n- Shows detailed compression statistics for each image\n- Reports which slides contain the largest remaining images\n\n## Requirements\n\n- Python 3.6+\n- ImageMagick (`magick` command must be available in PATH)\n\n## Usage\n\nFirst, [compress all images in PowerPoint](https://support.microsoft.com/en-us/office/reduce-the-file-size-of-your-powerpoint-presentations-9548ffd4-d853-41e7-8e40-b606bca036b4).\n\nThen, run the tool:\n\n```bash\nuvx slidecompress presentation.pptx\n```\n\nOr with custom maximum image width:\n\n```bash\nuvx slidecompress --width 480 presentation.pptx\n```\n\nThe compressed file will be saved as `presentation.compressed.pptx` in the same directory.\n\nTo overwrite the original file, use the `-f` flag:\n\n```bash\nuvx slidecompress -f presentation.pptx\n```\n\n## Example Output\n\n```\n image1.png: 9.7KB compressed by 1.4KB\n image2.png: 4.5KB\n image3.jpeg: 19.6KB compressed by 2.3KB\n image4.emf: 98.2KB compressed by 25.3KB and converted to .png\nLargest media after compression:\n image4.emf: 72.9KB in slide 4\n image3.jpeg: 17.3KB in slide 3\n image1.png: 8.3KB in slide 1\n image2.png: 4.5KB in slide 2\n```\n\n## Build\n\nTo build and upload to PyPI:\n\n1. Update the version in `pyproject.toml`\n2. Build and upload the package\n\n```\nrm -rf dist/\nuvx --from build pyproject-build\nuvx twine upload -u __token__ dist/*\n```\n\n## License\n\nMIT\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Compress PowerPoint presentations by optimizing embedded images",
"version": "0.1.3",
"project_urls": {
"Homepage": "https://github.com/sanand0/slidecompress"
},
"split_keywords": [
"compression",
" images",
" optimization",
" powerpoint"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "006ad0a2c3018db00c0f9bbcba32625b7e85392a868b6db9297e16459d561340",
"md5": "6339b53c9534cd40ade362211994fb45",
"sha256": "41f85557c680eb5078d83183c931f2132b5cc29b62aaf1122a7e295d6c1b2e47"
},
"downloads": -1,
"filename": "slidecompress-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6339b53c9534cd40ade362211994fb45",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4086,
"upload_time": "2025-02-13T16:16:45",
"upload_time_iso_8601": "2025-02-13T16:16:45.219627Z",
"url": "https://files.pythonhosted.org/packages/00/6a/d0a2c3018db00c0f9bbcba32625b7e85392a868b6db9297e16459d561340/slidecompress-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "25ca9caca433b90f9cd5bc6371d477824dc03a248a03da6738b76b623f8518eb",
"md5": "fd348ed6b5dfd59332316d71b8ff8bb5",
"sha256": "6f31d800dc1670db39195524b185d8e4813acf619c0a8623f521560c52e6e612"
},
"downloads": -1,
"filename": "slidecompress-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "fd348ed6b5dfd59332316d71b8ff8bb5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 3395,
"upload_time": "2025-02-13T16:16:46",
"upload_time_iso_8601": "2025-02-13T16:16:46.114184Z",
"url": "https://files.pythonhosted.org/packages/25/ca/9caca433b90f9cd5bc6371d477824dc03a248a03da6738b76b623f8518eb/slidecompress-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-13 16:16:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sanand0",
"github_project": "slidecompress",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "slidecompress"
}