Connect with us

How to control WordPress jpeg Image Compression?

solution

How to control WordPress jpeg Image Compression?

Some of you WordPress site owners who are very particular about your images and image quality may have noticed that upon upload of your graphics to WordPress that your images lose just a little bit of quality.  Well, you are right, WordPress actually saves it’s uploaded files to 90% quality JPEG files during the “crunching” process.  And for those select few that are bothered by this 10% drop in quality, well there is an easy fix!  Plop the single line below into your themes functions.php file and BAM!, image quality is set to 100% moving forward.

add_filter('jpeg_quality', function($arg){return 100;});

 

The same concept could apply to those of your trying to save just a wee bit of disk space.  You could alternatively bump the quality down to 75% or 80% to make file sizes smaller while still maintaining some decent looking images.  That snippet below is included:

add_filter('jpeg_quality', function($arg){return 80;});

 

The choice is yours, up it, down it, or just leave it alone.  Just another flexible option of WordPress.

Continue Reading
Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

More in solution

    About Me:

    Szabi Kisded

    Hey there, I'm Szabi. At 30 years old, I quit my IT job and started my own business and became a full time WordPress plugin developer, blogger and stay-at-home dad. Here I'm documenting my journey earning an online (semi)passive income. Read more

    Sign up for my newsletter and get the YouTube Caption Scraper WordPress plugin for free
    (worth 29$)!

    All My Plugins In A Bundle:

    My AutoBlogging Plugins:

    My Online Courses:

    A Theme I Recommend:

    Featured Posts:

    To Top