PixSlim
PixSlim is a lightweight and easy-to-use Python package for compressing images, PDF, and Microsoft Word documents while maintaining the best possible quality.
✨ Features
| Feature | Status |
|---|---|
| 🖼 Image Compression | ✅ |
| 📄 PDF Compression | ✅ |
| 📝 DOCX Compression | ✅ |
| 🎯 Target File Size | ✅ |
| ⚡ Fast & Lightweight | ✅ |
| 🐍 Python 3.9+ | ✅ |
📦 Installation
pip install Pixslim
🚀 Quick Start
from Pixslim import compressor
compressor = compressor(target_kb=500)
result = compressor.compress(
"input.jpg",
"output.jpg"
)
print(result)
Example Output
{
"original_kb": 1523.45,
"final_kb": 487.31,
"reduction_percent": 68.01,
"quality": 80,
"size": (1920, 1080)
}
📂 Supported Formats
| 📂 Category | 📁 Formats | 🚀 Supported |
|---|---|---|
| 🖼 Images | JPG, JPEG, PNG, BMP, TIFF, WEBP | ✅ |
| 📄 Documents | PDF, DOCX | ✅ |
📚 Dependencies
| 📦 Package | Purpose |
|---|---|
| Pillow | Image compression |
| PyMuPDF | PDF optimization |
| python-docx | Microsoft Word document handling |
Install manually if needed:
pip install Pillow PyMuPDF python-docx
📖 API
Create a Compressor
compressor = compressor(target_kb=500)
Compress a File
result = compressor.compress(
input_file="input.pdf",
output_file="output.pdf"
)
📊 Return Value
PixSlim returns a dictionary like this:
{
"original_kb": 1024.55,
"final_kb": 498.23,
"reduction_percent": 51.37,
"quality": 80,
"size": (1920, 1080)
}
📋 Project Information
| Property | Value |
|---|---|
| Package Name | Pixslim |
| Version | 1.1.0 |
| Python | 3.9+ |
| License | MIT |
| Author | Fatemeh SHM |
📄 License
This project is licensed under the MIT License.
🌟 More Projects
If you enjoy Pixslim , you might also like this project ,too:
snapforge
A lightweight, fast and intuitive Python library for image processing built on top of Pillow.
❤️ About
Thank you for using PixSlim.
If PixSlim helps you, consider sharing it with other Python developers.
Author
Fatemeh SHM
Release files for Pixslim 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pixslim-1.1.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pixslim-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / pixslim-1.1.0.tar.gz
| Download URL | pixslim-1.1.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8a79c734275bf8f337754c09c4d24451ae9257ead55069c5f7632b96d664e120
|
|
BLAKE2b-256 checksum How to use checksums |
5c9f1b2697821c83dabea51c180e2a70948781733388ea7370455c7b88260ed8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / pixslim-1.1.0-py3-none-any.whl
| Download URL | pixslim-1.1.0-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c6940a3b04f0caa3197b20e2b438369ef6490b8943dd150969286f13f68d37a
|
|
BLAKE2b-256 checksum How to use checksums |
d3dfb40ab43aa071d73898c3a97c6ed124ebf8d44f26aae9de8ac79df36335c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|