The following function disables image compression:
add_filter( 'wp_editor_set_quality', function( $arg ) {
return 100;
});
Does this cover WebP images as well as JPEGs?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityIt does cover webp as well. From several google pages the default compression was 86. You could also test to confirm by uploading a few with different settings in your functions. This issue on Github shows they changed the default quality to 82. https://github.com/WordPress/performance/issues/563.
We can see that webp images use the same quality value as jpeg images here.