Thankfully there are applications online that will help you do this without having to build your own script and run the image one by one through different compressions, if your a windows user, I recommend that you take a look at FileOptimizer.Check Out Our Video Guide to Optimizing Images for SEOįirst, why do you need to format your images? What are the benefits? There are numerous benefits of optimizing your images for performance. You will find with lossless compression applications, results vary depending on the image, not the application, so often you have to use an array of lossless compression and pick the best size. Many people will use a script or application that will run the file in multiple lossless compressions and find the best results, this is particular more useful in PNG than JPEG because the results can actually be more than 5-50kb different. You will often find that lossless compression will vary from one image ot the next depending on the software your using, some images compress better in one tool but may not do better in the next and vice versa. If you are using aws s3, vanish, CloudFlare or a similar service you will need to purge the cache before testing. If you have tried jpegtran but still got Google insights nagging at you then it may be caused server-side caching which is still delivering the old version of the image, this is common with content delivery networks and reverse HTTP proxy's. Generally the JPEG compression in most imaging software such as Photoshop will do, you just need to compression it again using a lossless application. What this means is it takes an already compressed file and makes it even smaller by stripping down the things it doesn't need, such as hidden META information.Įffective you are compressing the file twice. jpegoptim, jpegtran, jpegrescan, mozjpeg1, mozjpeg2 and so on are all lossless compression tools, not JPEG encoders such as Guetzli. Looks like you're getting your wires mixed, Google insights refers to lossless compression, not the JPEG encoder. (There is a protected question on stackoverflow from 2011 but none of the answers work anymore: ) How can I compress the images (slight quality loss is okay) so they are as small as the images I can download from Google Insights? Since there are hundreds of images on the site using Google Insight to compress them all isn't really practical.Īre there any command line tools for linux that will compress as well as Google Insight? So how can I compress (hundreds of) Jpegs automatically (on a linux machine) so Google Page Speed Insights doesn't complain anymore?Įdit: To clarify: Google Insights allows you to download optimized images, and they really are much smaller than anything I am able to produce. This did compress the images much better than before, but Page Speed Insights still complains that the images are to big. Then I tried Guetzli, a new jpeg encoder from Google itself. I tried both with various different settings, but they didn't compress the images any further, and sometimes the images actually got bigger. They suggest jpegtran and jpegoptim for jpeg images. I looked at the official image compression FAQ here. Using the Google Page Speed Mod for Apache/Nginx is not an option. I need to automatically compress images (uploaded by users) so Google Page Speed Insights doesn't complain about the image size anymore. I would have asked on Stackoverflow, but there is a similar question there that was closed with the suggestion to ask at Server Fault, and Server Fault closed my question with the suggestion to ask here (which is extremly frustrating):
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |