![](/hugo-portfolio/project/image-compressor/featured_hu6214b6c7edbae393fd7f03119c62e9c8_226134_720x2500_fit_q75_h2_lanczos_3.webp)
The Image Compression Web Application is a simple Flask-based web application that allows users to upload images for compression while maintaining image quality. The application utilizes the popular Python Imaging Library (PIL) to perform image compression.
Table of Contents
Features
- Upload images for compression while maintaining quality.
- Download the compressed image for further use.
- User-friendly web interface powered by Flask.
- Error messages for unsupported formats and compression failures.
Getting Started
Prerequisites
- Python 3.6 or higher
- Flask (pip install Flask)
- Python Imaging Library (PIL) (pip install Pillow)
Installation
- Clone the repository:
git clone https://github.com/k1lgor/image-compressor.git
cd image-compressor
- Install the required dependencies:
pip install -r requirements.txt
Running the Application
- Navigate to the project directory:
cd image-compressor
- Run the Flask application:
flask run
- Open your web browser and go to http://localhost:5000 to access the application.
Usage
Uploading an Image
- Visit the application URL (e.g., http://localhost:5000).
- Click the “Browse” button to select an image from your local machine.
- Click the “Compress and Download” button to initiate the compression process.
- The iamge will be downloaded automatically.
Using Docker
You can also run the application using Docker and Docker Compose.
- Make sure you have Docker and Docker Compose installed.
- Build the Docker Image:
docker build -t image-compressor .
- Start the application using Docker Compose:
docker-compose up -d
- Open your web browser and go to http://localhost:5000 to access the application.
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Code Coverage
For detailed code coverage information, see the Code Coverage Report.