Improve Image Quality and Color in WordPress

Ever notice how WordPress smushes your JPG images down to 60% quality after your upload them?  Add the snippet below to your theme’s functions.php or alternatively, download this plugin to improve the quality of your JPG images to 100%.  Please note: You will sacrifice speed for quality.

function gpp_jpeg_quality_callback($arg)
{
return (int)100;
}

add_filter('jpeg_quality', 'gpp_jpeg_quality_callback');
Newsletter
Join over 280,000 independent website owners

The next person to join our monthly newsletter gets a 25% off coupon!

We guarantee 100% privacy. Your information will not be shared.

This entry was posted in . Bookmark the permalink.

Posted by , at Graph Paper Press

Thad is the founder of Theme.Works and Graph Paper Press. Previously, he produced online multimedia and documentary projects for USA Today including the inauguration of President Barack Obama and many others. He lives in Brooklyn, NY with his wife Abby.

  • Google
  • Blog
  • Instagram

11 thoughts on “Improve Image Quality and Color in WordPress”

  1. Hello Thad,

    thanks for your work to improve image quality on wordpress, I was very disappointed by wordpress when I saw degraded quality after my upload.

    However it’s like your code does not work on my website. I will try to explain my case :

    If I upload a picture which size (width, height) is larger than my “large picture size” set up in wordpress config, the quality is degraded after upload.

    If I upload a picture which size is lower than my “large picture size” set up in wordpress config, quality is OK.

    I have the same results with or without your code in my function.php.

    Do you have an idea of what is going on please ?
    Thanks
    François

    1. Sounds like WordPress is “up-sizing” your images François. This honestly shouldn’t happen. Perhaps your theme is scaling up the images using CSS to fit the site design. Themes sometimes do this.

      1. Any Idea where in css i can find it? cos i have similar situation the pic what i upload is very bad and its doesnt metter which size is photo.

  2. I installed this plugin but unfortunately it’s not working with WordPress 3.9.1 The same bad quality is showing. 🙁

  3. Checking the class-wp-image-editor.php file I noticed there is another function that has a higher priority over the filter.

    set_quality() has priority over the filter.

    It would worth to consider it.

Leave a Reply