- Sep 10, 2010
- 11,807
- 26,660
I have seen multiple people asking how to compress images without using a premium service. Obviously, Photoshop is one of the best ways of doing it; but what if you are broke? 
The solution is to use ffmpeg. Yeah, it's a crazily good and open source software for video processing; but images? Turns out, that it does that just as well as videos!
I don't want to bore you with a crazily long ass method thread, so let me upload the setup I used to test the compression. This is only valid for Windows, but you can always download ffmpeg for your OS and modify the batch script to use it on your OS.
Download the zip from here (alternatively, you could download ffmpeg from their official website, and just use the bat file in the folder that I am sharing):
VT Scan:
How to use the script?
Just download the zip, and extract it in a folder. Now, open the folder in file explorer and SHIFT + right click on the folder. From there, open folder in Command Prompt (alternatively, press Windows + R, type cmd and press ENTER. Then type cd folderpath). Once you are in that folder, just run:
It will take all the images in that folder, compress them, and output the compressed files to a sub folder called processed (it will create the sub folder if it does not exist).
Now, delete the example images I gave; and paste your images instead. For the images I gave you, it does compress them quite a bit. Original size of those images were 2.10mb in total, and the compressed ones were 857kb; without losing too much detail or scaling the image dimensions down.
Another good thing about this is the speed. ffmpeg is blazingly fast, and your images will be converted in a blink of an eye.
Let me know if it works out for you. If you need help converting the script to a bash script (in case you are on linux), let me know.
The solution is to use ffmpeg. Yeah, it's a crazily good and open source software for video processing; but images? Turns out, that it does that just as well as videos!
I don't want to bore you with a crazily long ass method thread, so let me upload the setup I used to test the compression. This is only valid for Windows, but you can always download ffmpeg for your OS and modify the batch script to use it on your OS.
Download the zip from here (alternatively, you could download ffmpeg from their official website, and just use the bat file in the folder that I am sharing):
Code:
https://www.mediafire.com/file/tr961ljy75aq9x9/images.zip/file
VT Scan:
Code:
https://www.virustotal.com/gui/file/ce0ea0f01d42f358a91dbf8b29b043eda40d53c9bd6287c0feec7c8ba3985ceb/detection
How to use the script?
Just download the zip, and extract it in a folder. Now, open the folder in file explorer and SHIFT + right click on the folder. From there, open folder in Command Prompt (alternatively, press Windows + R, type cmd and press ENTER. Then type cd folderpath). Once you are in that folder, just run:
Code:
.\batch.bat
It will take all the images in that folder, compress them, and output the compressed files to a sub folder called processed (it will create the sub folder if it does not exist).
Now, delete the example images I gave; and paste your images instead. For the images I gave you, it does compress them quite a bit. Original size of those images were 2.10mb in total, and the compressed ones were 857kb; without losing too much detail or scaling the image dimensions down.
Another good thing about this is the speed. ffmpeg is blazingly fast, and your images will be converted in a blink of an eye.
Let me know if it works out for you. If you need help converting the script to a bash script (in case you are on linux), let me know.