When you need to share media, and you don't need high quality, this script allows you to compress images and videos.
- Put some media files in the folder where the script is located.
- Run one of the scripts
Start Optimization
: to optimize each media file in this folder.Compare
: to do a low, medium and high quality optimization on each media file in this folder. Be careful, it will take three times longer. Try it only on some small files to test.
Images : jpg, jpeg, png, bmp, gif, tif, tiff
Videos : avi, mp4, mov, divx, mkv, mpg, webm
-
HandBrakeCLI from Handbrake
Convert all videos files into MP4
ℹ https://handbrake.fr/docs/en/latest/cli/cli-options.html -
convert from ImageMagik
Convert images files in PNG
ℹ https://imagemagick.org/script/convert.php -
jpegoptim
Optimize JPG files
ℹ https://www.kokkonen.net/tjko/src/man/jpegoptim.txt -
pngquant
Optimize PNG files
ℹ https://pngquant.org/#manual