Optimizing and loss-less compressing images is one of those items that always pops up when analyzing your website with Google PageSpeed Insights. Images have to be loss-less compressed to save many bytes of data and thus bandwidth. This speeds up the download time of your website. But, how do we optimize images for the web? Or, what if I have hundreds of images that needs optimization? Let’s optimize and loss-less compress images in bulk, read on.
Google PageSpeed Insights already mentions the tools, we only have to download and use them.
So, go ahead and download OptiPNG. There is no installation required, it’s a run once executable for the command line.
If you are familiar with the command line, for example on Windows 7 and higher, you can very easily execute OptiPNG with its default settings on all your PNG files in a directory:
D:\Dev\sites> FOR /F %I in ('dir /b/s *.png') do @c:\optipng-0.7.4-win32\optipng.exe %I
This will loss-less compress and optimize all PNG images in bulk, found within
d:\dev\sites\ and recursively into sub directories, making your images and website-footprint smaller, resulting in a faster download of your website.
My name is Jan. I am not a hacker, coder, developer, programmer or guru. I am merely a system administrator, doing my daily thing at Vevida in the Netherlands. With over 15 years of experience, my specialties include Windows Server, IIS, Linux (CentOS, Debian), security, PHP, WordPress, websites & optimization. Want to support me and donate? Use this link: https://paypal.me/jreilink.
Automatically flush Redis cache after publishing a WordPress post
WordPress .htaccess security best practices in Apache 2.4.6+
Set WP_MEMORY_LIMIT value correctly in wp-config.php
How to: Protect WordPress from brute-force XML-RPC attacks
Remove Jetpack email sharing service
How to make Twenty Seventeen theme full width in WordPress
Check WordPress Core files integrity
Clear PHP opcode caches before WordPress Updates: ease the updating process