The image compressor is a lightweight and straightforward tool that is capable of reducing the size of images. It utilizes an algorithm inspired by PCA (Principal Component Analysis) to compress images, resulting in a size reduction of at least 50% compared to the original size. By using this tool, you can effectively save memory and storage space.
To use the Image Compressor, follow these steps:
- clone this repository:
git clone https://github.com/ErfanMomeniii/image-compressor.git
- install the required dependencies:
pip install -r requirements.txt
To compress an image, run the following command:
python setup.py -c "image.jpg"
Replace image.jpg
with the path of your input image and it will output compressed file like image.npz
.
To decompress an image from .npz
file, run the following command:
python setup.py -d "image.npz"
Like compressing, replace image.npz
with the path of your compressed file.
Contributions are welcome! If you would like to contribute to the Image Compressor project, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Make your changes and commit them:
git commit -m 'Add your feature'
- Push to the branch:
git push origin feature/your-feature
- Submit a pull request.
This project is licensed under the MIT License.
For any questions or suggestions, feel free to reach out to me at erfamm5@gmail.com.