WordPress used to compress images it resizes (thumbnails, not the originally uploaded version) with 90% compression. Since WP version 4.5 it compresses to 82%. To revert to the 90% compression level, add the following to the functions.php file. You can also set it to 100% but that usually increases the file size.
- wp_editor_set_quality: general image compression level
- jpeg_quality: supersedes the general level
> // HWS: change the default image compression value (thumbnails)
add_filter('jpeg_quality', function($arg){return 90;});
add_filter( 'wp_editor_set_quality', function($arg){return 90;} );
Code language: PHP (php)
You can also change it in the Imsanity plugin
See also
- <https://developer.wordpress.org/reference/hooks/wp_editor_set_quality/>
- <http://enviragallery.com/how-to-get-around-the-new-wordpress-image-compression-settings/>
- <https://fixmywp.com/blog/stop-wp-compressing-uploaded-jpeg-images.php>