Files
pptx-image-compress/README.md
T

61 lines
2.6 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# PPTX Image Compressor (CaesiumCLT only)
**Version 1.1.8**
Dieses Paket enthält:
```
PPTX-Image-Compressor/
├─ README.md
├─ install_and_run.bat
├─ pptx_image_compress.py
├─ bin/
│ └─ caesiumclt.exe
```
## Schnellstart (ohne Admin-Rechte)
1) Doppelklicke `install_and_run.bat` **oder** rufe es in CMD/PowerShell auf, z.B.:
**Single**
```bat
install_and_run.bat -i "C:\Slides\Deck.pptx" -t 8 -q 90
```
**Batch**
```bat
install_and_run.bat -i "C:\Slides\*.pptx" -O "C:\Slides\out" -t 8 -q 85
install_and_run.bat --input-dir "C:\Slides" --recursive -O "C:\Slides\out" -q 80
```
Die Batch lädt bei Bedarf automatisch das **Windows Embeddable Python Package**, entpackt es lokal und führt das Tool aus.
Zusätzlich wird **pip** installiert, damit das **svg-polish** Modul installiert werden kann.
## Was das Tool macht
- Entpackt die PPTX in einen TempOrdner
- Komprimiert **JPG/JPEG, PNG, WebP, GIF** mit **CaesiumCLT** (Default `-q 90`, `-O bigger`)
- Komprimiert **SVG** mit **svg-polish** (Default-Modus: `agressive`)
- Ersetzt Bilder nur, wenn die komprimierte Datei kleiner ist
- Versucht bei PNG zusätzlich einen PNG->JPG Wechsel, wenn das Bild nach Kompression noch größer als 500 KB ist
- Ersetzt Bilder nur, wenn sei mindestens 2% kleiner sind (verhindert *doppelte Komprimierung*)
- Schreibt ein CSVLog (`.log` neben der OutputPPTX)
- Baut eine neue PPTX und zeigt eine Summary (Name, Größe vorher/nachher, Ersparnis %, Zeit)
## Änderungen in 1.1.8
- SVG Files werden bei Vorhandensein von svg-polish anhand von 2 Profilen optimiert: balanced|agressive
## Hinweise
- `-t` steuert die Parallelität der PythonThreads; intern wird `caesiumclt --threads 1` gesetzt, sobald `-t > 1`, um Oversubscription zu vermeiden. Default ist 16
- `-q` steuert das Qualitätslevel; intern wird `caesiumclt -q` mit diesem Wert von `0..100` benutzt, Default ist 90
- `--min-savings` steuert das Mindestmass an Komprimierung zur Verhinderung von doppelter Komprimierunt, Default ist 2%
- Die Batch **verwendet bevorzugt das Embeddable Python** neben der BAT; ansonsten sucht sie echte `python.exe`/`py.exe` im PATH, **ignoriert** aber die MicrosoftStoreAliasPfade (`WindowsApps`).
- `--svg-profile` steuert das Vector-Optimierungsprofil `balanced|agressive`
## Manuelle Nutzung des .py (falls Python vorhanden)
```bat
python pptx_image_compress.py -i "C:\Pfad\input.pptx" -t 8
```
## Quellen & Tools
- CaesiumCLT Projekt/Downloads: https://github.com/Lymphatus/caesium-clt
- SVG Polish - https://github.com/g-battaglia/svg_polish
- Windows Embeddable Python Package Doku/Downloads: https://docs.python.org/3/using/windows.html