Welcome to our step-by-step guide on how to utilize CompressioWeb, an open-source production-grade image compression API and web application. In this blog, we’ll outline the installation process, usage instructions, and troubleshooting tips to ensure a smooth experience.
What is CompressioWeb?
CompressioWeb is a user-friendly tool for compressing images (JPG, PNG, GIF, SVG) with both lossy and lossless formats. Built using Node.js, Express.js, and React.js, it is designed for those who prioritize privacy as it operates without any logs, cookies, or databases. Images are automatically deleted an hour after upload!
How to Use the API
To get started with CompressioWeb, follow the points below to send requests efficiently:
- POST Request: Use a POST request to compressio.app to upload images. You can upload up to 10 images at once with a total size limit of 50MB.
- Compression Type: By default, images will be compressed using the lossy format. If you want to opt for lossless compression, include the
isLossykey with a value of false in your request. - Compression Quality: You can set the compression quality from 1 to 100 using the
imgQualitykey. Note that this won’t apply ifisLossyis set to false. The default for JPG, PNG, and SVG is 85, while for GIF it is 50. Avoid using values lower than 50 for GIFs to prevent severe quality loss. - Strip Metadata: By default, metadata is stripped from images. If you want to keep it, set the
stripMetakey to false.
Installation Steps
Let’s dive into the installation steps for running CompressioWeb on a DigitalOcean Ubuntu 20.04 server:
- Step 1: Start by updating your package list and installing Nginx and Node.js:
sudo apt update
sudo apt install nginx -y
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
sudo apt install nodejs -y
sudo apt install jpegoptim pngquant optipng gifsicle scour -y
pm2 for process management:npm install -g pm2
pm2 start app.js -n CompressioAPI
pm2 startup
pm2 save
Troubleshooting Common Issues
If you encounter any issues during setup or usage, here are some troubleshooting ideas:
- Ensure all necessary libraries are installed correctly. Try reinstalling them if you face issues.
- Verify that your API server is running by checking its status with pm2.
- Check your Nginx configuration for any syntax errors using
nginx -t. - If you get a 404 error, confirm that the file paths are set correctly in your Nginx configuration.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Understanding the Code Analogy
Let’s clarify the image compression process with an analogy:
Imagine your favorite bakery producing various cake sizes for customers — from small cupcakes to towering wedding cakes. Each cake requires precise measurements to ensure it is baked perfectly and fits into the intended design.
In the same way, CompressioWeb carefully measures and adjusts digital images to reduce their file size while retaining as much quality as possible. This process may involve cutting down on the richness of flavors (lossy compression) or making subtle tweaks to maintain every detail without sacrificing taste (lossless compression). Just as each cake needs the right recipe and ingredients, each image requires the right compression settings to look fabulous and fit nicely into a webpage!
Conclusion
CompressioWeb stands out as a reliable and privacy-conscious solution for image compression. By following the outlined installation and usage instructions, you can get up and running effortlessly!
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

